zotherstupidguy
zotherstupidguy

Reputation: 3024

Migrate Grail's HSQLDB embedded database

how to migrate Grail's HSQLDB embedded database(That contains my App's Data that I don't want to lose) into external one, such as MySQL or ApacheDerby?

Upvotes: 2

Views: 1075

Answers (3)

Colin Harrington
Colin Harrington

Reputation: 4459

The MySQL Migration Toolkit may be exactly what you need.

A little searching turned up this article that shows examples of what the GUI Tool looks like.

I haven't had to migrate data from a HSQLDB to any other DB, but if I had data that I didn't want to use in a HSQLDB then I'd definitely try this method.

  • You are going to want to backup the HSQLDB database that you want to save (I'm assuming you used a file DB rather than an in-memory one right?)
  • Change your DataSource to a MySQL datasource with the dbCreate set to update (or something non-destructive)
  • Run the Migration Toolkit and migrate your data

Otherwise you ought to be able to view the data in your DB by using another tool (DBVisualizer, RazorDB, or others) and they might be able to help you export the data.

Upvotes: 1

Raphael
Raphael

Reputation: 1800

If your data isn't important just let hibernate regenerate your schema, else try this: http://www.grails.org/plugin/liquibase

Upvotes: 2

Jean Barmash
Jean Barmash

Reputation: 4788

Because grails uses hibernate underneath, no migration is necessary. All you need to do is repoint your conf\DataSources.groovy to the new database, and next time you startup, it will create tables in the new DB.

See section 3.3 in this doc for more information on MySQL config.

Upvotes: 1

Related Questions