Postgresql – Oracle to PostgreSQL

migrationoraclepostgresql

I'm having som test databases running Oracle 10 & 11 that I plan to try to migrate to PostgreSQL.

Some googling hinted that the perl script "ora2pg" could be of use, and free of charge. However, now I've spent too much time trying to get that running on my winx64 machine, since MinGw won't compile it and activeperl modules hates me.

Are there any other worthy, free, tools to take a look at or should I get a Linuxbox up & running and try ora2pg that way?

Regards

Best Answer

We also found existing tools tricky to work with, so ended up hacking together a solution using the sqlalchemy library in python. Our general approach was to mirror the source database; hackily convert data types where necessary; create the target database; copy across the data in chunks.

For an example, see: https://github.com/MIT-LCP/oracle2postgres/blob/master/migration.ipynb. Using this approach, we migrated a fairly large database (~100 schema, with >1000 tables, some tables with >200 million rows) from Oracle to Postgres.

For more detail, see: https://github.com/MIT-LCP/oracle2postgres. The package can be installed with pip install oracle2postgres. If you hit problems when reusing the code, feel free to raise an issue and we'll do our best to help.