Last Updated: February 25, 2016
· caioariede

Migrate an existing database from MySQL to PostgreSQL

For some reason you need to migrate an existing database from MySQL to PostgreSQL and then you find out that this might not be an easy task.

I just found a Python package that will make the hard work for you. Assuming you already have the Python setuptools package installed, you can just:

pip install py-mysql2pgsql

So run it. At the first time it will generate a config file:

py-mysql2pgsql -v

Edit mysql2pgsql.yml with the MySQL and PostgreSQL settings.

Run it again to migrate your database:

py-mysql2pgsql -v

For more info, take a look at:

1 Response
Add your response

There is also a gem from Ruby world called taps:

over 1 year ago ·