Muthukannan Kanniappan
Muthukannan Kanniappan

Reputation: 2079

Mysql to Postgresql conversion tool in Java

Is there a Java tool that can convert mysql dump into postgresql dump available.

Googling got me this, https://github.com/maxlapshin/mysql2postgres. Which is a ruby gem. In my current development environment installing Ruby is not allowed.

The versions used

Note: mysqldump --compatible=postgresql didnt work!

Thanks.

Upvotes: 1

Views: 1485

Answers (2)

Burhan Khalid
Burhan Khalid

Reputation: 174614

Consider downloading the advanced server and use the built-in migration toolkit.

However, you should as Craig said - upgrade to a supported version of postgresql.

Upvotes: 0

Craig Ringer
Craig Ringer

Reputation: 324275

First, PostgreSQL 8.2 is ancient and unsupported. Upgrade urgently. Read the release notes for each .0 version to find out about any compatibility issues you may face.

As for the conversion, you should generally do it in two phases. Convert and load the schema, then convert and load the data.

Generally automated tools won't do a good job converting database schemas. You should do a schema-only dump, run a conversion tool over it then hand-edit and hand-check it before loading it into PostgreSQL.

Once you have a schema that looks sane, do a data-only dump from MySQL and try loading that into a PostgreSQL instance with your converted schema loaded in it. mysqldump --compatible=postgresql may do a better job, though you'll probably need additional flags too.

If you try it and still don't have any luck, consider following up with more detail. Report exact error messages not just "doesn't work" if you follow up.

Upvotes: 2

Related Questions