Live migration is a migration strategy to move a large amount of data (100 GB-10 TB+) with low downtime (on the order of minutes of downtime). It is significantly more complicated to execute than a migration with downtime using pg_dump/restore, but supports more use-cases and has less requirements than the dual-write and backfill method.
Note
In the context of migrations, your existing production database is referred to as the "source" database, while the new Timescale database that you intend to migrate your data to is referred to as the "target" database.
Live migration leverages Postgres' built-in replication functionality to provide a seamless migration with very little application downtime.
Roughly, it consists of four steps:
- Prepare and create replication slot in source database.
- Copy schema from source to target, optionally enabling hypertables.
- Copy data from source to target while capturing changes.
- Apply captured changes from source to target.
Currently live migration only supports migrating from PostgreSQL, but we are actively working on supporting TimescaleDB.
Live migration works well when:
- Large, busy tables have primary keys, or don't have many
UPDATE
orDELETE
statements. - The insert workload does not exceed 20'000 rows per second, and inserts are batched. If your application exceeds this, you should use the dual-write and backfill migration method.
For more information, consult the step-by-step migration guide:
Keywords
Found an issue on this page?
Report an issue!