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?
If your data isn't important just let hibernate regenerate your schema, else try this: http://www.grails.org/plugin/liquibase
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.
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.
精彩评论