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.
Related
converting a project and looking for a way to connect to DB schema, read it and generate knexJS migration files to integrate in new project.
Is there a way to do this? and how?
No, there is no way to extract migration file for current schema of some database. If you really want to create one, it must be written manually.
But you don't even need one. You can just start using knex, with your old database dump and in the future when there should be changes done to the schema you can write new migrations for those specific incremental changes to the schema.
For running migrations you should use knex's migration functionality.
I'm considering a MySQL to Postgresql migration for my web application, but I'm having a really hard time converting my existing MySQL database to Postgresql.
I tried :
mysldump with --compatible=postgresql
migration wizard from EnterpriseDB
Postgresql Data Wizard from EMS
DBConvert from DMSoft
and NONE of the above programs do a good job converting my database!
I saw some Perl and Python scripts for converting mysql to postgresql, but I can't figure out how to use them....(I installed ActivePerl and don't understand what I'm supposed to do next to run that script!)
I use Auto Increment fields (as a primary key) all the time, and these are just ignored... I understand that Postgresql does auto-increments in another way (with sequences), but it can't be THAT hard for MIGRATION software to implement that, or is it?
Did anybody have better luck converting a MySQL database with auto-increments as primary keys?
I know this is probably not the answer you are looking for, but: I don't believe in "automated" migration tools.
Take your existing SQL Scripts that create your database schema, do a search and replace for the necessary data types (autonumber maps to serial which does all the sequence handling automagically for you), remove all the "engine=" stuff and then run the new script against Postgres.
Dump the old database into flat files and import them into the target.
I have done this several times with sample databases that were intended for MySQL and it really doesn't take that long.
Probably just as long as trying all the different "automated" tools.
Why not use an ETL Tool? you dont have to worry about dumps or stuff like that.
I have migrated to PostgresSQL and MySQL and have had no problems with the auto increment fields.
You just need to know the connection credentials and thats it. I personally use Pentaho ( it's open source ).
Download Pentaho ETL from http://kettle.pentaho.org/
Unzip and run Pentaho (using .bat file spoon.bat)
Create a new Job:
Create DB connection for source data base (PostgreSQL) - using menu: Tools→Wizard→Create DataBase Connection (F3) Create DB connection for destination data base (Mysql) - using technique described above.
Run the Wizard: Tools → Wizard → Copy Tables (Ctrl-F10).
Select source (left dialog panel), and destination (left dialog panel). Click Finish.
The Job will be generated - Run the job.
If you need any help let me know.
Even when you familiar with all "PostgreSQL gotchas", doing every step by hand may take a lot of time, especially when your db is "big".
Try some other scripts/tools.
I know this is an old question but I just ran into the same problem migrating from MySQL to Postgres. After trying several migration tools out the very best one I could find, which will migrate your database structure as cleanly as possible, was Pgloader https://github.com/dimitri/pgloader/ it will take care of changing the Auto Increment to Postgres sequences no problem and it's super fast.
I'm creating a new Asp.Net MVC 3 application. Visual Studio does a lot of the job of create the database and initial layout. Very nice! I will upload that initial files to my server, but I want that it runs using the MySql database on the server.
There's some quick/easy way to do it? I'm not worried about the data, just the structure of the tables, and the connection/configuration changes.
Thank you very much!
You can export any MS-SQL database as a Script (Sql Server manager).
Fix it up to make it compatible.
But you will also need a Membership provider, look around if there exist any for MySql, otherwise you'll have to create one (movie).
There are a number of tools listed in "Migrating from Microsoft SQL Server and Access to MySQL".
Or (assuming that you're using column types that exist on both platforms) you can write a script to convert a schema dump from SqlServer into MySQL (or do the conversion by hand in a text editor). Even better yet, you can write a program program to read the INFORMATION_SCHEMA table from SqlServer and produce the necessary CREATE TABLE... statements in mysql. Lots of options.
So I am very new to web development and working on a new project that will make use of Nhibernate as my ORM and MySql database.
I wanted to set it up so that NHibernate would create my database table based on the (all necessary NHibernate files). So far I have concluded that NHibernate will generate the DB schema that I have laid out with the mappings and class files.
The problem I am seeing is that it appears that you must have the database in place in MySql first for NHibernate to create the table (understood). However, when reviewing creating a MySql database in the manual it is requiring you to specify the schema with the create command.
So far the number of blogs I have read concentrate on what you need for NHibernate and not much details in correctly prepping your MySql server.
Any direction or advise is greatly appreciated.
You need to run the "create database [databasename];" command before building up your schema. You don't neeed to specify a schema to use this command.
Basically this task is pretty easy when you think about it, but I found no answers in Microsoft Access or MSDN. I have to create a connection to a new Database and query the old one. After validating the old data, everything is written in a new fine Form to the my new Database.
Any Ideas?
Add:
Old Database is a Firebird Database. This Data needs to be re-structured and migrated to a new MySQL Database.
If no binary data in your database, I'd suggest just doing a csv export and reimporting.
You'll need to create the schema separately in MySQL but it's not difficult, there are lots of tutorials, and you can probably find a Firebird tool to export the DDL into a script that will either just work, or be easy to modify.
If you want to use Access in the middle, just attach each of the two external databases from Access (using ODBC or your choice of drivers). You can use the query designer wizards to build a INSERT INTO ... FROM ... type query as you would for any other situation.
You can use a tool like database workbench.
Why you want to migrate to MySQL ?
if you can access the firebird database via ODBC, i suggest the mysql migration toolkit.