Last Updated: February 25, 2016
·
1.66K
· 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:
http://pypi.python.org/pypi/py-mysql2pgsql

1 Response
Add your response

There is also a gem from Ruby world called taps: https://github.com/ricardochimal/taps

over 1 year ago ·