views:

48

answers:

6

Hi, is it possible to convert a SQL Server database file to a MySQL Database file and if so what would be the best way to go about doing this. Thanks.

A: 

I do not know of other tools but this is what I have : Visual studio 2008 express (SQL Kit installed along with) MySQL full Install + Administrator toolkits (Available at their website)

Migration using these workd like a charm. So you will have no problems.

loxxy
+1  A: 

There are some programs out there that supposed to help migrate MS SQL databases to MySQL and vise versa (though such programs won't be able to convert complex databases or won't do a good job). I can't recommend one because I've never used one before.

This link might be helpful http://dev.mysql.com/tech-resources/articles/migrating-from-microsoft.html

del.ave
+1  A: 

Take a look at the Migration Toolkit if your MySQL is 5.0 or later Of course you cannot expect 100% perfect transition as the other answers suggested.

renick
A: 

Have you looked at MySqls migration tool kit?

http://dev.mysql.com/doc/migration-toolkit/en/mysql-migration-toolkit-indepth-sourcedb-mssql.html

This is where I would recommend starting.

Abe Miessler
A: 

I did this recently. Tried the migration tool kit, and it didn't end up working too well for me. Ended up writing a lot of my own code to get the job done. Depending on the complexity of the database, it could take a lot of work. Took us a year to get the whole migration done. Oh, and once you get the table schemas and data transfered, that's when the real fun starts. Hope you don't use too many stored procedures. You'll have to rewrite all of those.

If you have a really simple schema, with a simple application, it might not be too difficult. Or if you knew you might want to migrate ahead of time, and designed for it, you might be ok. But if you have a big existing application, and there was no initial plan to migrate, it could be a huge job.

Kibbee
+1  A: 

Consider installing SQL Server Express to help get the job done. It's free, and in a pinch, you can install it in a VM if you don't have a dedicated Windows machine to get the job done.

  • attach the .mdf into SQL Server Express.
  • generate CREATE scripts for the tables, views and stored procedures, and any/all objects you need.
  • generate the data insert scripts if you want to keep the data.
  • parse through any stored procedure scripts to remove any TSQL specific implementation, and replace with MySQL equivalents. This could be a small or large amount of work, depending on how many sprocs are required to move over.
  • publish the CREATE and INSERT scripts to the target MySQL database.

Here are some screenshots on generating those scripts in SQL Server.

alt text alt text

p.campbell