Tuesday, September 15, 2009

Migrate MySQL to postgres

I just googled around on how to do migration from MySQL to postgresql. I ended up with unavailable script of phyton. However, I found Use mysql-postgresql-wizard of component EnterpriseDB which can be used to . You can download the source from here:

http://downloads.enterprisedb.com/src/mysql_pg_wizard_src.zip

You need to download Apache Ant to build the source. I use Apache Ant 1.7.0. Use the following command on how to build the jar file:

ant dist

Executing the above command will produce a jar file which is MigrationWizard.jar. To get the wizard of migrating the mysql to postgres, you need to execute the jar file using the following command in the /dist directory:

java -jar MigrationWizard.jar

The following wizard should be poped up once you execute the above command.

3 comments:

James said...

Thanks for the help. I was able to get the application up and running, but it looks like the tool is creating a separate schema of its own in my Postgres database. Do you know how to make the migration create all the tables in the "public" schema?

Thanks.

adhit194 said...

halo rie,


Apa alesan pindah dari mysql ke postgreSQL ?

Arie said...

@James:
I am sorry, I havent come across into the need of changing my scheme. I believe there is a way in postgres to change the scheme. maybe the following doc can help you:
* http://www.postgresql.org/docs/8.1/interactive/sql-alterschema.html

However, I havent tried it but its worth to try.

@adhit
Yaa biasanya masalah preferences siy... ada orang yang seneng ini,, seneng itu.. tapi gw butuh untuk pindah karna perlu penyesuaian dengan database nya customer.. jadi yaa... mesti di pindah :D