Migrating HSQLDB to MySQL

HSQLDB migration to MySQL is not out of the box supported by mysql. The MySQL Workbench can only handle with dumps made by other mysql server. HSQLDB Transfer Tool is no longer bundled with the standard hsqldb jar file in the 1.8.x or later releases. After downloading and building with

ant hsqldbutil

you get in lib an additional hsqldbutil jar. With the hsqldb.jar, the hsqldbutil.jar and and mysql connector jar in my classpath i tried the Database Manager (From Tools menu choose transfer) from hsql with no luck. The MySQL Migration Toolkit has reached the EOL phase but works perfect for me. After downloading add the hsqldb jar to the lib folder C:\Program Files (x86)\MySQL\MySQL Tools for 5.0\java\lib. I update as well the mysql connector to the latest one.

  1. Start your hsqldb server from command line
    1. java -cp hsqldb-1.8.0.10.jar org.hsqldb.Server -database <path to your hsqldb files>\<database name>
  2. Start MySQL Migration Toolkit
  3. Choose direct migration
  4. Choose as Source a generic jdbc
  5. Enter “org.hsqldb.jdbcDriver” as classname
  6. Enter “jdbc:hsqldb:hsql://localhost” as connection string
  7. Enter “sa” as username and leave password empty
  8. click next
  9. Configure your mysql connection
  10. click next
  11. choose public as schema
  12. click next several time till screen “object creation options”
  13. choose “create script file..” instead of “create objects online”
  14. click next several time till screen “data mapping options”
  15. choose “create script file..” instead of “transfer data online”
  16. click next several time till screen “Summary”
  17. click finish

With the sql you can use tools like phpmyadmin or the mysql workbench to import your data into the mysql server.