1

How can I migrate my FogBugz database from SQL Server to MySQL?

flag

3 Answers

3

Back Up!

Back up your database before the move. Keep the backup of your original DB after the move in case you discover problems later, in particular missing Attachments.

Mind the Versions!

It's very important that you move your data between databases that were created by the same version of FogBugz. e.g. If you are using an older version of FogBugz, upgrade it to the latest version before the move. If you can't do that, make sure to install the same version for the destination database.


Try ESF Database Migration Toolkit. It can migrate data from SQL Server to MySQL or back in 3 steps.

http://www.easyfrom.net/download/

From Fog Creek: Once you have the database converted, you should migrate the data itself into a FogBugz-generated schema. This can be accomplished by using an empty FogBugz database. Then, you can use this script to generate a file that will contain the correct SQL to select all the data out of each table into the empty schema.

Note that plugin table names have the ixPlugin value in them, which is determined by the order they were installed in FogBugz. You may have to manually change the table names so that the fresh destination database matches the source database.

SET @old_database = 'fogbugz_converted';


SET @new_database = 'fogbugz_final';


SELECT CONCAT(
  "SELECT '",TABLE_NAME, "'; ",
  " TRUNCATE ",@new_database,".", TABLE_NAME,"; ",
  " INSERT INTO ", @new_database,".",TABLE_NAME,"(", GROUP_CONCAT(COLUMN_NAME ORDER BY ORDINAL_POSITION), ") ",
  " SELECT ", GROUP_CONCAT(COLUMN_NAME ORDER BY ORDINAL_POSITION), " FROM ",@old_database,".", TABLE_NAME,"; ",
  " SHOW WARNINGS;") AS Statement 
FROM INFORMATION_SCHEMA.COLUMNS 
    WHERE TABLE_SCHEMA = @new_database 
      AND TABLE_NAME NOT IN ('dbcopier','dbupdate','dbsession','dbsessiondata','version','fblock','fragmentcache','fragmentdependency','id','indexdelta','indexfile','indexfilepage','trainingrequest') 

      AND COLUMN_NAME NOT LIKE 'FILTER_%' 
    GROUP BY TABLE_NAME 
INTO OUTFILE 'c:\\dump.sql';


SOURCE c:\\dump.sql
link|flag
2

http://dev.mysql.com/downloads/gui-tools/5.0.html

I actually used the (now deprecated/no longer supported) MySQL Migration Utility to go from SQL 2008 to MySQL 5.1 with no difficulty whatsoever. Actually, it went very very fast (transferred a 4.3GB SQL database to MySQL in about an hour) and it just plain worked.

I can't justify $250 for the ESF tool. Not for a one-time transfer when the free tool works fine!

link|flag
0

There are several data migration tool available on google to convert database like, you can easily search for it, i use dbload for such aim.

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.