About pg_chameleon

pg_chameleon is a MySQL to PostgreSQL replica system written in Python 3. The system use the library mysql-replication to pull the row images from MySQL which are stored into PostgreSQL as JSONB. A pl/pgsql function decodes the jsonb values and replays the changes against the PostgreSQL database.


  • Read from multiple MySQL schemas and restore them it into a target PostgreSQL database. The source and target schema names can be different.
  • Setup PostgreSQL to act as a MySQL slave.
  • Support for enumerated and binary data types.
  • Discard of rubbish data coming from the replica.
  • Conservative approach to the replica. Tables which generate errors are automatically excluded from the replica.
  • Possibilty to refresh single tables or single schemas.
  • Basic replica monitoring.
  • Detach replica from MySQL for migration support.
  • Data type override (e.g. tinyint(1) to boolean)
  • Daemonised init_replica process.
  • Daemonised replica process with two separated subprocess, one for the read and one for the replay.
  • Rollbar integration


1. What are the license terms?

pg_chameleon is released under the terms of the 2 clause BSD license. You can find out the license text here.

2. Is it possible to use it for migrations?

Definitely yes. Please check in the blog section for the tutorial.

3. What about the green chameleon?

Igor is the mascot of pg_chameleon. It was made by Elena Toma, an Italian Talented Lady. Please visit her page https://tonkipappero.deviantart.com/ and give her kudos for the amazing work.

4. Do you offer commercial support for the tool?

Currently I don’t offer any commercial support. The system is free as beer and free as freedom, and will always stay this way.

5. How are the tool’s performances?

The system is currently used in production. It gets the data from a MySQL database which generates ~ 2,000 commits per second. The read and replay lag usually never exceeds the 10 seconds.

However the replay lag in particular depends on the PostgreSQL load. Your mileage may vary.