If you are using mostly open source in your enterprise, and have few MS SQL server database around, you might want to consider migrating those to MySQL database.
The following are few reasons why you might want to consider migrating Microsoft SQL Server to MySQL database:
- To avoid huge License and support fees of MS SQL Server. In MySQL, even if you decide to use the MySQL enterprise edition, it is less expensive.
- Unlike SQL Server, MySQL supports wide range of Operating Systems including several Linux distros, Solaris and Mac.
- To implement a highly scalable database infrastructure
- To take advantage of several advanced features of MySQL database that have been tested intensively over the years by a huge open source community
We can migrate MS SQL database to MySQL using migration module of “MySQL Workbench” utility.
The most easiest way to install MySQL Workbench is to install “Oracle MySQL installer for windows”, which installs several MySQL tools including the Workbench.
Download and install this MySQL Installer, which includes Workbench and other necessary connectors and drivers required for the migration.
The following is an overview of the steps involved in the migration of MsSql database to MySQL using Workbench migration wizard.
1. Take care of Prerequisites
Before starting the MySQL database migration wizard in Workbench, we need to ensure that ODBC drivers are present for connecting to the source Microsoft SQL Server database, as it is not bundled with Workbench.
Verify that the max_allowed_packet option in the MySQL server is sufficient for the largest field to be migrated.
Ensure that we can connect to both destination MySQL server database, and source MsSQL Server database with appropriate privileges that are required for migrating the data across.
In the MySQL Workbench, the migration wizard will display the following “Migration task list” that you’ll need to go through to finish the migration.
2. Select Source and Target Database
First, define the source Microsoft SQL Server database connection parameter. Select “Microsoft SQL Server” from the database system dropdown list. In the parameters tab, select the DSN, and specify the username to the source database.
Next, define the destination MySQL database connection paramter. Select “Local Instance MySQL” or “Remote Instance MySQL” depending on your situation. In the parameters tab, specify the hostname or the ip-address where the MySQL database is running, the MySQL port, username. If you don’t specify the password, it will prompt you.
Once you specify the source and destination, all available schemas and databases will be listed. You can select the specific schema that you like to migration (or select all), and you can also specify custom schema mapping to the destination MySQL database.
3. Migrate the Objects
In this step the Microsoft SQL Server schema objects, table objects, data types, default values, indexes, primary keys are converted. Please note that view object, function objects and stored procedures are just copied and is commented out as we will need to convert those manually.
4. Data Migration
In this step the automated copy of data is done from source to destination database for the migrated tables.
Please note that using the migration wizard we can only convert tables and copy data but cannot convert the triggers, views and stored procedures. We’ll have to do those manually, which we might cover in one of the future article on how to migrate MS SQL stored procedures to MySQL stored procedures.
Comments on this entry are closed.
Thank you, will definitely give it a try
Nice one…..many thanks..
Nice one …..many thanks.
Very interesting! Thanks for sharing!
Very Relevant, thanks. The next step is how to make 3rd party apps which currently connect to SQL Server to connect to MySQL instead ? They don’t seem to use ODBC, but connect “natively” somehow to the server in a Windoze environment. ๐
Hi,
Very useful article for migration
I have used SQLyog for this. SQLyog provides Import External Data to streamline the transfer of data from any ODBC compliant data source to MySQL.
Excellent.
As I am new for MsSQL and MySQL, I have some questions.
1. It is just setup one time.
2.After data migration, do you mean that we can use MySQL/PHP program to browse and update MsSQL database?
Thank you for your sharing.
I’m using the Workbench migration tool to migrate a MSSQL schema to MySQL. it migrates the schema successfully without any errors. However, when I tried to migrate data, I got “Not enough memory to allocate insert buffer of size 1073741824” error.
I tried to set the bulk_insert_buffer_size to 1073741824 and 2147483648, it doesn’t work.
max_allowed_packet = 1073741824
Can you please advise what I should do? any recommendation will be appreciated.
Thank you!
If your table engine is InnoDB then increase innodb_buffer_pool_size.
If you are using MyISSAM then Increase key_buffer_size.
You can verify the size of above variables by executing following statement.
SHOW VARIABLES LIKE ‘%buffer%’ ;
While migrating ms sql data to mysql it skip ms sql procedures,functions and view part.Pls help what to do
The link you provided (MySQL Installer) has nothing called MySQL Installer that page. It has tons of downloads, none of which, as an SQL server user, mean a thing to me. I clicked on “MySQL Downloads ยป” which led me to “MySQL on Windows (Installer & Tools)” which led me to “MySQL on Windows (Installer & Tools)” I thought that was it but that led me to yet another page which had six separate downloads none of which motioned SQL Server.
We have about 100 customers and I would not mind in the least giving less money to MS so I would love to give MySQL a try but it needs to be easy-at least to try. When I can’t even figure out what I need to download I know we are off to a bad start so I gave up. I don’t have the time for that.
I need two things, A good migration tool, and something similar to management studio to manage it.