Converting MS-SQL to MySql (from .bak file or otherwise)

March 17, 2009 – 12:52 pm

What to expect:

Using this methodology, you’ll be able to move table definitions and the data contained within those tables. However, you will NOT move Views, Stored Procedures, Triggers, etc.

Views arrive as simple tables, so be prepared to recreate them by hand. Procedures don’t arrive at all, so same “manuality” applies.

These are the steps to convert an MS-SQL database to MySql:

First, you will need access to a machine that runs MS-SQL, so if all you have is a .bak file, you will first need to restore a database from it within MS-SQL before you can covert it.

(Skip this step if your DB already up  and running).
If you don’t have MS-SQL running on your machine, download SQL Server Management Studio Express, a free tool from Microsoft that allows you to work with MS-SQL databases.
After installing, open the program and see if you can connect to your local machine. In my case I couldn’t becauseI didn’t have all the required services running.

To start the services, go to “Control Panel -> Administrative Tools -> Services” and look for 2 services: “SQL Server”, and “SQL Server Browser”. Start those. Now SQLSMSE should let you connect.

Restore DatabaseTo restore a database from a .bak file, simply right-click on the Databases item in the Object Explorer, select “Restore Database” and follow the directions. Voila, you should end up with a running MS-SQL database.

Now for the actual conversion to MySql:

You will need to have a MySql ODBC connector installed on your machine, which you can get from
(You don’t have to register to get the driver!)

Once installed, you need to add a new data source to your machine. Go to “Control Panel -> Administrative Tools -> Data Source” and under User DSN click “Add” and select the newly installed MySql ODBC driver. Then point this to the target MySql database (if it doesn’t yet exist, create it first).

Great! So now we have a source database, a target database, and both can transfer data via ODBC. All that’s left to do is fire up the Import / Export Data Wizard that comes with MS-SQL and select the appropriate input/output settings, and convert.

Filed under: Rnadom Sftuf — by Richtermeister

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress