Using pg_chameleon

One way to move from MySQL/MariaDB to PostgreSQL is to use Federico Campoli's tool, called pg_chameleon, which can be downloaded for free from GitHub: https://github.com/the4thdoctor/pg_chameleon. It has been explicitly designed to replicate data to PostgreSQL and does a lot of work, such as converting the schema for you.

Basically, the tool performs the following four steps:

  1. pg_chameleon reads the schema and data from MySQL and creates a schema in PostgreSQL.
  2. Stores MySQL's master connection information in PostgreSQL.
  3. Creates primary keys and indices in PostgreSQL.
  4. Replicates from MySQL/MariaDB to PostgreSQL.

The pg_chameleon tool provides basic support for DDLs such as CREATE, DROP, ALTER TABLE, and DROP PRIMARY KEY ...

Get Mastering PostgreSQL 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.