Translator from MySQL to liquibase

Do you guys know if there are any tools to convert SQL scripts into LB .xlm files? It would really come in handy in order to import all my previous changes and sum them up in order to be able to do a fresh install of my app.

Thank you for the answer. My bad with the “.xlm” typo. I was looking for something to convert individual sql scripts int xml change sets. If there isn’t any similar tool around, I’ll just make one with the most frequent commands myself. If anybody is interested, I would gladly share it, because I consider it a useful thing to have. Good day to you all.

I assume you mean .xml rather than .xlm

What you would do is:
  1. Create a clean, empty database.

  2. Apply the SQL scripts that you have to the database.

  3. Run the Liquibase generateChangelog command on that database.

Note that this will only capture the end state of the database - i.e. if you have a SQL script that creates a table, and then another later SQL script that drops the table, the XML will not have a and a .

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Ah, I see what you are saying. In that case, I can see how a tool might be useful. We have written something like that recently using DaticalDB. We have a command line interface for DaticalDB that is somewhat similar to the one for Liquibase, but works with “project” files that can contain connection information for multiple databases. The command line itself is scriptable using groovy. We wrote a groovy script that will do basically what is described above, but for multiple SQL files. Right now our target databases are Oracle and MS SQL Server, so we use their command line tools to apply the SQL scripts to the database, then use the Liquibase diffChangelog command to ‘convert’ the SQL that was applied to the database into XML changesets.

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

The easiest approach is to execute the SQL files against your oracle database, then run generateChangeLog which will output the xml changelog needed to create the database. 

You may need to modify some datatypes to make the changelog work against postgresql, but it will be a fairly simple “try/see errors/search and replace/try again” cycle until it works.

Nathan

Hi,

I need the assistance to convert the oracle sql files into liquibase xml format and then migrate to Postgresql DB.

As there are list of sql’s + Data which are XML format of internal application tool , which need to migrate to liquibase tool and to postgresql DB.

Please let me know you assistance and ant other tools.

Thanks

Rupesh

Hi,

Thanks very Much.

Do we have tool to migrate?  and what abt CLOB and BLOB datatypes, as it does not generated if extracted from oracle DB. we need to specify manually Rupesh

Hi,

Please can you reply urgently, we need assistance on it.

Thanks

Rupesh

There is nothing that I know of in Liquibase that can help convert CLOB or BLOB datatypes. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Hi AlexandruGageonea,

It would be really great if you can share what you have to convert SQL files to .xml file. That will be really helpful.

Thanks