1

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

  • Mysql 5.1
  • Postgres 8.2

Note: mysqldump --compatible=postgresql didnt work!

Thanks.

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

thank u for the info. Since my schema is small and didnt have much time, I did a manual conversion.. Just asked for GK. Thanks.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.