Database migration

Large Production Database - PostgreSQL migration with logical replication

Moving a live production database from AWS EC2 to a new server with minimal downtime.

Architecture

The problem

A 500 GB production PostgreSQL database had to move hosts. A dump-and-restore would have meant hours of downtime.

Approach

  • Replicated schema first, then streamed data with PostgreSQL logical replication.
  • Used publications for non-partitioned tables and handled partitioned tables separately.
  • Resolved replication-slot, OID-mismatch and disk-space issues during the sync.
  • Cut over once the subscriber had caught up, then fixed sequences.

Outcome

  • Production kept running during the bulk copy; downtime limited to the final cutover.

Have a platform that needs to scale, stay up, or move clouds?

Tell me what you’re building. You’ll get a reply within one working day — with questions, not a sales pitch.