SQL Server migration to mySQL, tips & potential issues? [closed] - mysql

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm looking into whether a move from SQL Server is a viable option. To help me with this decision, I have some questions:
Is it possible to use asp.net membership on a MySQL server ?
Are there many/any useful tools to migrate tables/databases/etc and which ones are the best?
What are the Main disadvantages in moving to MySQL from SQL Server?
As it stands I have a large enough project but it doesn't avail of many MS features so if it's possible I'd like to move.

My company did this a couple years ago with a pretty big project. On thing that made it easier for us is that we mostly used very plain standards compliant SQL. No Linq, no Entity Framework, only a little T-SQL, and only a few stored procedures.
As far as getting your data into MySQL, We ended up creating our own tool for doing this. None of the existing stuff including "MySQL Migration Assistant" can anywhere close to being fully functional. Once you can recreate the schema on MySQL, Getting the data back in, is a matter of exporting to CSV and importing with LOAD DATA INFILE. Tranferring the schema was actually the hardest part. With so many tables, we couldn't just do it by hand. We wrote some code in .Net by starting off using this VBScript that we found, and upgraded it to use the tools in "Microsoft.SqlServer.Management" Namespace available for .Net.
For functions that exist in SQL Server but don't exist in MySQL, such as GetDate, it's easy enough to write your own functions in MySQL that map to these functions, instead of trying to find all the instances of this stuff in the code. There are quite a few syntax differences between MySQL and SQL Server, even with just using basic SQL. For instance MSSQL allows DELETE TABLENAME WHERE ...., but MySQL insists you use DELETE FROM TABLENAME WHERE..... That's just one, there are many other differences.
Anyway, it was quite an adventure, but it worked out well for us. It is do-able, but you have to be committed, and not be afraid to write your own migration tools.

Couple of things off the top of my head.
MySQL doesn't support CHECK constraints. Usually, if your dbms does support CHECK constraints, your tables use them.
Depending on the constraint, you might be able to rewrite it in one of these ways.
As a foreign key to a new table
As a trigger
As a daily (or hourly, whatever) exception report
As a module in application code (which could be part of an exception report)
Something else I haven't thought of.
MySQL's timestamps have a resolution of one second.

Microsoft has a SQL Server Migration Assistant but, naturally, it is designed to help users move in the other direction.
You may want to check out this whitepaper from the MySQL site (you'll need to register - I did not, so I don't know how valuable the paper will be compared to the knowledge you already possess):
http://www.mysql.com/why-mysql/white-papers/mysql_wp_mssql2mysql.php
There are also some products and guides that can be found with a fairly simple search, e.g.
http://www.spectralcore.com/fullconvert/tutorials/convert-mssql-sql-server-to-mysql.php
http://www.haidongji.com/2009/02/23/moving-data-from-sql-server-to-mysql/
I don't know that the ASP.NET Membership can be ported directly to MySQL but I am confident you could replicate its functionality (it is more a question of how much effort it will take, not whether or not it is possible).

Related

Database Development - General Structure and Planning [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm about to start a fresh project and I'm good on normalization of the data. My question is the business I'm working for has a number of tables on MS Sql Server and some version of Oracle. Access to create temporary or even use temporary tables may be limited. We might be able to setup our own tables but chances are 50/50. The approach taken in the past has been to create temporary tables as needed for data dumps into MS Access.
If I can edit / create tables on the SQL server then I'm good, but if not I was thinking about setting up one of the spare machines as a MySQL or MS Sql Express server rather than using Access as a number of these types of projects have been completed in the past and push towards a gig in size due to the amount of data downloaded for preparing reports. Would this be a reasonable approach if I'm locked out of MS Sql server or Oracle? What would you do if your hands were tied in a similar fashion?
To provide a little more insight here, the data dumps are often used to build dozens of excel reports (mostly charts). I was thinking if I can use the MS Sql or Oracle to do all the work via triggers / stored procedures / etc. then perhaps I can eliminate the need for Access and just download the data via VBA using Excel only to reduce the amount of time it takes to build the reports.
Maybe I can use an ORM and some kind of VB.net code rather than excel to build the charts faster?
I'm open to suggestions, let me know what you all think and any questions I'll try to answer the best I can
Although setting up a PC with something like SQL Server Express or MySQL often sounds like a great idea, I strongly suggest that you get the backing of your boss before doing something of this nature. Installing unapproved software on inappropriate/unmaintained workstations is often frowned upon with extreme prejudice. Were I to do this at my current place of employment I'm confident I'd be looking for a job as soon as it was uncovered. I completely agree that just about anything is better than MS Access - however, supporting an architecture such as the one you describe, at least temporarily until you can find a better gig, is probably better than unemployment. YMMV.
Share and enjoy.
Actually the most easy solution here would be to continue to use access as a front end, and simply link to the tables on the particular server database system in question. That way you save all the money time and resources of having to pull down and build temporary local tables.
The end result is you get to continue to use Access as a great RAD tool, but enjoy the benefits of the security, performance and scalability of the server based system in question.

SQL databases beginner [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Hi I am interested in learning SQL databases something I should have done a long time ago but I kept avoiding it for some reason.I realized that there are diferent versions of SQL(MySQL , SQL-Server etc.)and now I am prety confused on witch one to learn.I would like to start learning SQL from w3school but to be honest I dont really know what to use for writing SELECT , DELETE statements and more importantly how to run it.I know that in order to create databases you need tables and I used Microsoft Acces for that but after creating the tables I don't know what to do next.I should mention that there are 2 reasons why I wana learn SQL:
1.For using it with PHP web development
2.I have a course at coledge in witch we study C# and I need to be able to learn how to create SQL databases so I can connect to them
Can you tell me what are the diferences beetween MySQL and SQL-Server?
What should I use for creating and manipulating databases?
And what resources or book could you recomend for learning SQL ?
Thanx in advance and sorry if my statements are vague I have never had anything to do with databases before
Both MySQL and Micorosoft SQL Server are so called Relational Database Management Systems (RDBMS). Data is structured in tables of rows and columns, and relations are made between the tables. MySQL is an open source solution, while SQL Server is not. There is however a free edition of Sql Server available called "Sql Server Express". You manage it through the software "Management Console", which I think is included in the download. http://www.microsoft.com/express
Both uses the SQL-language to interact with the stored data, they do have some differences though. SQL Server uses a variant called "T-SQL" while MySQL uses "SQL/PSM". The basics are however the same.
Good luck!
First, check out RDBMS in Wikipedia for a comparison of DBs. Things change regularly, but this can give you a good idea.
Second, you can use PHP w/ MSSQL.
Third, you can use C# with MySQL, but in Visual Studio, it is very easy to use MSSQL and much more feature support.
As a student you can download all of the MS products you need from Dreamspark plus you can get a free subscription to PluralSight which is online video tutorials from beginner to advanced use of MS products.
PHP is fun and I've had more success using MySQL with PHP, but if you will have a class learning C# and MSSQL, you might as well start learning there.
since you use PHP, the best way you start is Mysql.
Check http://www.apachefriends.org/pt_br/xampp.html
With XAMPP you can run your php apps and user PHP mysqladmin to learn more bout SQL syntax.
Good Luck

ASP.NET+ MySQL on a large scale. Recommended? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm thinking of using ASP.NET and MySQL together on a large project. Does anyone have any experience in using these two on a large scale and are there any aspects I should be wary of? If there is a chance that there could be compatibility issues, then I may be prepared to purchase an MSSQL license, but I'd rather go the free route right now. In theory it's possible, but how easy is it to transfer a MySQL database to and MSSQL database in the future?
Thanks
(I'll make this a CW if requested).
Mysql is quite capable as a database engine, although the performance optimization techniques that apply to mysql are obviously different from those that apply to SQL Server.
Some of the largest sites in the world use mysql - last I checked, YouTube ran mysql. So you definitely don't need a commercial product to get good performance.
You will have a lot of trouble porting a non-trivial mysql database to SQL Server or any other DBMS. There are major differences between platforms. I think you'll be much better off picking one platform and sticking to it.
As for ASP.NET, well, in my experience WebForms can be a bit slow, although the ASP.NET backend itself is also very efficient, as evidenced by the numerous large ASP.NET MVC apps out there (such as StackOverflow!)
Edit - are there problems with the combination of ASP.NET and mysql? Well, that depends. The mysql ADO.NET connector is solid and performs just as well as the SQL Server connector. Linq to SQL doesn't support mysql out of the box, although there are 3rd-party products such as LightSpeed which are supposed to do it well, and of course NHibernate supports it (although documentation is a bit harder to find, but that only matters when you're getting started).
In general you'll probably find less support for mysql-related issues in .NET, you might find that mysql is a second-class citizen in the .NET community, but both technologies are solid and both are perfectly capable of talking to each other.
If you have the money, I'd probably spring for SQL Server on account of the support factor alone, or even start out with SQL Express if it's a very small site, but again, there are no serious problems using .NET with mysql.
I dont have any info on the scalabilty, however to make your transition as smoothe as possible from MySql to MS SQL, you'll want to make sure your using either the Db abstract classes, or the IDB type interfaces on your data access layer. Probably best to only use ANSI SQL while you are at it.
Go ahead with SQL Server 2012 Express Edition ( which is free) and then the migration will be made on the fly in case you need to upgrade to SQL Server 2012 Standard Edition.

Automate Syncing Oracle Tables With MySQL Tables [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
The university I work at uses Oracle for the database system. We currently have programs we run at night to download what we need into some local Access tables for our testing needs. Access is getting to small for this now and we need something bigger. Also, the nightly jobs require constant maintance to keep working (because of network issues, table changes, bad code :) ) and I would like to eliminate them to free us up for more important things.
I am most familiar with MySQL so I setup a test MySQL server. What is the best way to automate copying the needed tables from Oracle to MySQL?
Edit: I accepted the answer. I don't like the answer but it seems to be correct based on further research and the lack of other answers provided. Thanks to all for pondering my question and answering it.
I don't think there is really anything that is going to do this. If you could setup a local Oracle database, then most likely you could as oracle has various means of keeping two databases "in sync", provided they are both Oracle.
If you must use mysql, then likely you are going to just have to write something to sync the data, this is of course always going to run in the same problems you currently have with the access "database".
You could setup something with HSODBC and triggers, but
I've found HSODBC to be very memory hungry
This is only going to add more load to your DB, which you say is already heavily loaded during the day.
If the main thing you are doing is wanting a local Test copy of your oracle database, you would be best to setup syncing with a local version of oracle, as far as I can tell from the licenses, oracle is free for development copies ( I have seen some posts to the contrary, but if you find that is the case, you could always use something like Oracle XE)
Could you just copy the Oracle tables and then set them up as linked tables in MS Access? This way the front-end stays the same plus you keep everything in Oracle (less moving parts than exporting and importing).
As Kellyn said, there are lots of free tools. One of them is SQLWorkbench http://www.sql-workbench.net/, which works with any JDBC database, so MySQL and Oracle should work.
It can create tables in Oracle if needed, or just only copy over the (updated) data.
There are many tool available to migrate data from oracle to mysql if your database is not very complicated.
You can use open source tools like Kettle pentaho ETL tool or paid enterprise tools like DB convert: https://dbconvert.com/oracle/mysql/
Lastly you can write a script or program that migrates the data.
Please find links related to your question:
https://dba.stackexchange.com/questions/150343/how-to-sync-a-mysql-db-with-a-oracle-db
Migrate from Oracle to MySQL

How to export data from SQL Server 2005 to MySQL [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've been banging my head against SQL Server 2005 trying to get a lot of data out. I've been given a database with nearly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - strings aren't encapsulated, so you can't deal with any row that has a string with a comma in it (or whatever you use as a delimiter) and I would still have to hand write all of the create table statements, as obviously CSV doesn't tell you anything about the data types.
What would be better is if there was some tool that could connect to both SQL Server and MySQL, then do a copy. You lose views, stored procedures, trigger, etc, but it isn't hard to copy a table that only uses base types from one DB to another... is it?
Does anybody know of such a tool? I don't mind how many assumptions it makes or what simplifications occur, as long as it supports integer, float, datetime and string. I have to do a lot of pruning, normalising, etc. anyway so I don't care about keeping keys, relationships or anything like that, but I need the initial set of data in fast!
The best way that I have found is the MySQL Migration Toolkit provided by MySQL. I have used it successfully for some large migration projects.
Using MSSQL Management Studio i've transitioned tables with the MySQL OLE DB. Right click on your database and go to "Tasks->Export Data" from there you can specify a MsSQL OLE DB source, the MySQL OLE DB source and create the column mappings between the two data sources.
You'll most likely want to setup the database and tables in advance on the MySQL destination (the export will want to create the tables automatically, but this often results in failure). You can quickly create the tables in MySQL using the "Tasks->Generate Scripts" by right clicking on the database. Once your creation scripts are generated you'll need to step through and search/replace for keywords and types that exist in MSSQL to MYSQL.
Of course you could also backup the database like normal and find a utility which will restore the MSSQL backup on MYSQL. I'm not sure if one exists however.
SQL Server 2005 "Standard", "Developer" and "Enterprise" editions have SSIS, which replaced DTS from SQL server 2000. SSIS has a built-in connection to its own DB, and you can find a connection that someone else has written for MySQL. Here is one example. Once you have your connections, you should be able to create an SSIS package that moves data between the two.
I ddin't have to move data from SQLServer to MySQL, but I imagine that once the MySQL connection is installed, it works the same as moving data between two SQLServer DBs, which is pretty straight forward.
Rolling your own PHP solution will certainly work though I'm not sure if there is a good way to automatically duplicate the schema from one DB to the other (maybe this was your question).
If you are just copying data, and/or you need custom code anyway to convert between modified schemas between the two DB's, I would recommend using PHP 5.2+ and the PDO libraries. You'll be able to connect using PDO ODBC (and use MSSQL drivers). I had a lot of problems getting large text fields and multi-byte characters from MSSQL into PHP using other libraries.
Another tool to try would be the SQLMaestro suite. It is a little tricky nailing down the precise tool, but they have a variety of tools, both free and for purchase that handle a wide variety of tasks for multiple database platforms. I'd suggest trying the Data Wizard tool first for MySQL, since I believe that will have the proper "import" tool you need.