MS SQL Server migrate to MySQL: using Liquibase justifies learning curve?

Hello Liquibase users, I am currently re-writing a web-based app to use MySQL instead of MS Sql Server. I have been using dbVisalizer to run custom SQL statements to output .CSV files from SQL Server for subsequent import into MySQL. This works but is completely manual:

  • Has anybody used LiquiBase to migrate a Sql Server instance schema and records data to a MySQL instance?
  • Does the LiquiBase learning curve justify implementing LiquiBase for the target in the first bullet?

I’ve used liquibase for going the other direction: porting a mysql database to sqlserver.  The trouble is that the ability to do a schema and data diff to move from one database to another isn’t the main purpose of liquibase, but rather a side effect of features in it, so it may not work as well as other tools would for that purpose.  I definitely think learning liquibase is worth the learning curve to use it as your database change management tool going forward, and getting it to work for porting is a nice side effect, but that’s just me :slight_smile:

The steps I did to move a database from mysql to sqlserver is:

  1. Use the generateChangeLog command with the DATA option to get a starting snapshot of the mysql database schema and data.
  2. Go through the generated changelog file and make necessary changes (data type changes due to better options, different view definition syntax, etc)
  3. Execute the changelog against sqlserver.

In general it worked well, although there was some manual changes I needed to make to the generated changelog.  We were actually using it to support keeping a test dataset in mysql and exporting it to sqlserver, so it was a process we would run periodically, so we were able to script the required changelog changes.


Hello Nathan, thanks for the reply. I will definitely go with this for the following reasons:

  1. the liquibase Hibernate integration (we are using Hibernate) and how it lends itself to versioning (we use hg). And, the DATA command you used to export from MySQL.
  2. I have not really found as you say, other tools, to cover this task though they may be better I am not aware of anything that does not have very expensive commercial overtones.
  3. It worked for you and hopefully with Maven or the Servlet listener we may be able to pull-off a prod. DB real-time switch over.

I’ll come back from time-to-time to briefly report progress and issues in case this may be useful or interesting to some users. Thanks again for the support, David.