Sync MySQL to PostgreSQL
with real-time binlog CDC.
Replicate MySQL to PostgreSQL using binlog row-format CDC — sub-second lag, automatic type mapping, zero downtime. Migrate, replicate for analytics, or consolidate multiple MySQL databases into one Postgres.
rsync.ai connects to MySQL as a replica, reads binlog events in ROW format (GTID or file+position), snapshots your tables, then streams all subsequent changes to PostgreSQL in real time. MySQL types are mapped to Postgres equivalents automatically — TINYINT(1)→BOOLEAN, INT UNSIGNED→BIGINT, ENUM→TEXT, JSON→JSONB, DATETIME→TIMESTAMPTZ. Schema changes (ALTER TABLE) surface as review prompts. Works with MySQL 5.7+, RDS, Aurora, Cloud SQL, and PlanetScale.
- Sub-second replication lag via binlog ROW-format CDC
- GTID and file+position replication both supported
- Auto type mapping — TINYINT(1)→BOOLEAN, UNSIGNED→BIGINT, ENUM→TEXT
- DDL changes (ALTER TABLE) detected and propagated safely
How to replicate MySQL to PostgreSQL — 5 steps
From binlog setup to CDC streaming — typically under 10 minutes.
- 1
Enable MySQL binlog
Set `binlog_format=ROW` and `log_bin=ON` in your MySQL config (my.cnf / my.ini). Create a dedicated replication user: `CREATE USER 'rsync_cdc'@'%' IDENTIFIED BY '…'; GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'rsync_cdc'@'%';`. On Amazon RDS or Aurora, enable automated backups — that activates binlog automatically. Set the `binlog_format` parameter to ROW in your parameter group.
binlog_format=ROW · log_bin=ON · REPLICATION SLAVE + REPLICATION CLIENT - 2
Connect MySQL source
Provide your MySQL host, port (default 3306), replication username, password, and database name. rsync.ai connects as a replica, reads the current binlog position (or GTID set), and begins the initial snapshot of all selected tables. SSL/TLS and SSH tunnels are supported for databases inside a private VPC.
mysql://rsync_cdc:pass@host:3306/mydb - 3
Connect PostgreSQL destination
Provide your PostgreSQL host, port (default 5432), user, password, and target database. The user needs CREATE TABLE and INSERT/UPDATE/DELETE privileges on the target schema. rsync.ai will create the schema and tables for you if they don't already exist.
postgres://user:pass@host:5432/analytics - 4
Describe the sync in plain English
Tell rsync.ai what you want: 'Replicate all tables from MySQL mydb to PostgreSQL in real time.' The AI pipeline planner reads your MySQL schema, maps each table and column to Postgres equivalents, and proposes DDL for you to review. You can refine with follow-up instructions — 'exclude the sessions table' or 'hash the users.email column'.
No SQL · No YAML · No DAGs - 5
Select tables, approve DDL, CDC starts
rsync.ai shows each MySQL table with its proposed Postgres DDL and type mappings. Tick the tables you want, review any mapping decisions (UNSIGNED INT → BIGINT, TINYINT(1) → BOOLEAN, ENUM → TEXT with a CHECK constraint), then approve. rsync.ai takes a consistent snapshot, applies it to Postgres, then switches to streaming binlog events — sub-second lag at steady state.
Snapshot → streaming CDC, zero-downtime
MySQL → PostgreSQL type mapping
rsync.ai proposes these mappings automatically. You review and approve every mapping before any data moves.
| MySQL column | PostgreSQL column | Notes | |
|---|---|---|---|
| users (INT UNSIGNED id, VARCHAR email, TINYINT(1) active) | users (BIGINT id, TEXT email, BOOLEAN active) | INT UNSIGNED → BIGINT prevents overflow. TINYINT(1) → BOOLEAN maps 0/1 to false/true. | |
| orders (INT id, DECIMAL(10,2) total, DATETIME created_at) | orders (INT id, NUMERIC(10,2) total, TIMESTAMPTZ created_at) | DECIMAL → NUMERIC (exact semantics preserved). DATETIME → TIMESTAMPTZ with UTC normalisation. | |
| products (INT id, TEXT description, JSON metadata) | products (INT id, TEXT description, JSONB metadata) | MySQL JSON → Postgres JSONB. JSONB allows indexing and operator queries. | |
| sessions (VARCHAR(36) id, ENUM('active','expired') status) | sessions (VARCHAR(36) id, TEXT status) | MySQL ENUM → TEXT with a CHECK constraint enforcing the same allowed values. | |
| transactions (BIGINT id, DECIMAL(18,8) amount, DATETIME ts) | transactions (BIGINT id, NUMERIC(18,8) amount, TIMESTAMPTZ ts) | High-precision DECIMAL preserved as NUMERIC. Sub-second timestamps retained via TIMESTAMPTZ. | |
| audit_log (BIGINT id, VARCHAR(255) action, TEXT payload, DATETIME logged_at) | audit_log (BIGINT id, VARCHAR(255) action, TEXT payload, TIMESTAMPTZ logged_at) | High-volume append-only table. rsync.ai applies INSERTs only — no UPDATEs or DELETEs expected. |
rsync.ai vs. Fivetran, Airbyte, AWS DMS for MySQL → PostgreSQL
Honest trade-offs for real-time MySQL to Postgres replication.