XferDB v1.2.0 streams inserts, updates and deletes from a source database the application is still writing to, into the target.
DevOpsNovember 9, 2026•9 min read

XferDB v1.2.0 — Live migration (beta): keep the app running during the copy

XferDB v1.2.0 — Live migration (beta): keep the app running during the copy

I just shipped v1.2.0 of XferDB. The headline feature is live migration: XferDB copies your tables and then keeps the target following the source, change by change, until you're ready to switch over. Your application keeps writing to the source the whole time. The only pause is the cutover itself, and you decide when that happens.

It ships as a beta. It works end to end and runs in the compatibility matrix on every change, but it hasn't run against enough real workloads yet for me to call it done. Try it on a copy of your data first.

The other big piece is YugabyteDB, which is now a database type of its own, as a source, a target, and a live source.

Download

xferdb (CLI + API server)

PlatformBinary
Linux x86_64xferdb-linux-amd64
macOS Apple Siliconxferdb-darwin-arm64
macOS Intelxferdb-darwin-amd64

xferdb-web (Web UI, optional)

PlatformBinary
Linux x86_64xferdb-web-linux-amd64
macOS Apple Siliconxferdb-web-darwin-arm64
macOS Intelxferdb-web-darwin-amd64

Checksums: SHA256SUMS.

xferdb-web is a separate process — it holds no migration state or database credentials, it just serves the UI and reverse-proxies /api/* to xferdb server. Run it if you want the browser UI; the CLI works standalone without it.

If you'd rather build from source:

git clone https://github.com/bchan77/XferDB.git
cd XferDB && git checkout v1.2.0 && go build -o xferdb ./cmd/xferdb

Full list of changes: CHANGELOG.md. Step-by-step guide to live migration: docs/LIVE_MIGRATION.md.

Before you upgrade

Nothing to change this time. Existing projects, configs and scripts carry on as they are, and a project that already reaches YugabyteDB as postgres keeps working. Live migration is opt-in: nothing streams unless you ask for it.

What's in v1.2.0

Live migration (beta)

A regular migration is a snapshot: whatever the application writes to the source after a table is copied doesn't make it across, so you stop the application for the whole copy. On a big database that's hours of downtime. A live migration closes that gap:

  1. Readiness. XferDB checks the source can stream changes before anything starts.
  2. Copy and capture. It creates a replication slot, then copies the tables while capturing every change made in the meantime.
  3. Catch-up. It replays the changes made during the copy.
  4. Streaming. From then on, the target follows the source within a second or so.
  5. Cutover. When you're ready, you stop the application's writes and cut over. XferDB applies the last changes, sets the sequences, adds the foreign keys, and drops the replication slot.

It starts with a readiness check: logical replication enabled, the replication privilege, a free slot, a primary key and a usable replica identity on every table, and permission to create the publication. Anything missing comes with the command that fixes it.

The live migration readiness check in project settings: every requirement passes, with a warning that the replication slot's WAL has no size limitThe live migration readiness check in project settings: every requirement passes, with a warning that the replication slot's WAL has no size limit

Once it's streaming, the migration page shows how far the target is behind, how fast changes are being applied, and how much WAL the source is holding for XferDB:

A live migration streaming: the phase strip at Streaming, under a second of apply lag, 210 changes a second applied, and 342 KiB of WAL held on the sourceA live migration streaming: the phase strip at Streaming, under a second of apply lag, 210 changes a second applied, and 342 KiB of WAL held on the source

Each table shows the rows the initial copy wrote, then the inserts, updates and deletes the stream has applied to it since:

The table list during streaming: each table fully copied, with the inserts, updates and deletes streamed to it and how long ago the last one arrivedThe table list during streaming: each table fully copied, with the inserts, updates and deletes streamed to it and how long ago the last one arrived

These screenshots are from a real run, not a mock-up: 452,000 rows across four tables, PostgreSQL 16 to PostgreSQL, with a script writing new orders, updating statuses and deleting order items throughout. The initial copy took 5 seconds. By cutover, the stream had applied 21,235 changes. Then I stopped the writer and cut over:

A completed cutover: every change applied up to the cutover point, no writes since, three sequences set, foreign keys and checks added, and the replication slot droppedA completed cutover: every change applied up to the cutover point, no writes since, three sequences set, foreign keys and checks added, and the replication slot dropped

Validation then ran on its own and passed: 212,800 orders on both sides, including the 12,800 that only ever came across through the stream.

Some details that matter if you're going to run this for real:

  • The cutover checks that writes have actually stopped. If changes keep arriving after you start the cutover, it stops and goes back to streaming, rather than switching over with writes still landing on the old database. You can cut over again once they've stopped, or with Cut over anyway if you know those writes don't matter.
  • Schema changes pause the migration. If someone adds, drops or retypes a column on the source mid-stream, XferDB applies everything up to that point, then pauses and shows what changed. It doesn't run DDL on your target for you: you make the same change on the target, then resume.
  • It protects the source. A replication slot makes PostgreSQL keep WAL until it's consumed. The migration page shows how much WAL is held, and warns you when capture has been down for over a minute, when the slot nears max_slot_wal_keep_size, or when the disk holding XferDB's change queue runs low.
  • It survives restarts. Capture and apply run as their own processes. They keep going through an xferdb server restart, which reattaches to them, and they're restarted if they fail.
  • Nothing is left behind by accident. If a migration's cleanup couldn't reach the source, its replication slot shows up as a leftover stream in the readiness check, with a Drop button. XferDB never drops one on its own, because another XferDB server could be using the same source.

It works from the CLI too:

# check the source and target can do it
xferdb migrate --preflight --live

# copy, catch up, and return once it streams
xferdb migrate --live --until-streaming

# after you've stopped the application's writes
xferdb cutover

The source can be PostgreSQL (10 or later) or YugabyteDB. The target can be PostgreSQL, YugabyteDB, MySQL or SQLite.

YugabyteDB as its own type

YugabyteDB speaks the PostgreSQL protocol, so it has always worked as postgres, mostly. It's now a type of its own (yugabyte://, default port 5433), which lets XferDB handle where it differs from PostgreSQL:

  • Live migration from YugabyteDB. YugabyteDB's replication behaves differently enough that it needed its own handling: positions are hybrid times rather than WAL offsets, lag is reported as time rather than bytes, and a small heartbeat keeps an idle stream moving. If your application updates or deletes a row it already changed earlier in the same transaction, YugabyteDB needs a tserver flag for that; the guide covers it.
  • Hash-sharded tables copy in parallel. Paging a hash-sharded table in key order makes YugabyteDB scan and sort the whole table for every page. XferDB now splits such a table into hash ranges, copies them in parallel and checkpoints each one. That applies to live migrations too.
  • Primary keys before the data on a YugabyteDB target. YugabyteDB stores rows in primary-key order, so adding a key to a loaded table rewrites all of it; a 1M-row table spent minutes on that. The keys now go in while the tables are still empty.
  • Readiness checks that know what YugabyteDB needs, including fixing the replica identity it gives new tables by default, which logical replication refuses.

Fixes

  • Column defaults across databases. A source column's default went into the target's CREATE TABLE exactly as the source wrote it, so PostgreSQL → MySQL or SQLite failed on a default like now() before copying a single row. Defaults are now translated between dialects. A default with no equivalent on the target is left off, which doesn't change any copied data.
  • Re-running a PostgreSQL → PostgreSQL migration into an existing schema failed after copying every row, with multiple primary keys for table ... are not allowed. Objects the target already has are now skipped.
  • Tables dropped from the source stayed in the project forever, listed as pending on every run and counted in the total, so progress stopped short of 100% and the ETA was too long.
  • Validation retries a transient error (a YugabyteDB schema-version mismatch or a deadlock) instead of reporting it as a failed table.
  • Negative worker counts or batch sizes are refused. A number field in the web UI changed when you scrolled over it, which is how one got saved as -75.

Showing our work: 71/71 passing

v1.1.0 shipped at 53/53. The compatibility matrix is now 71 cases: MongoDB → PostgreSQL (24), MySQL → PostgreSQL (18), PostgreSQL → PostgreSQL (10), PostgreSQL → MySQL (4), PostgreSQL → SQLite (4), MySQL → SQLite (2) and MySQL → MySQL (1), plus eight YugabyteDB cases on 2025.2 and 2026.1: YugabyteDB → PostgreSQL, SQLite and YugabyteDB, and PostgreSQL → YugabyteDB.

Six of the 71 are live migrations: four from PostgreSQL (to PostgreSQL, MySQL and SQLite) and two from YugabyteDB. Each one copies, streams, cuts over and validates. Same setup as before: real databases in Kubernetes, a fresh namespace per case, and L2 validation on every result. The release itself passed the full set at small and medium size before it was tagged, along with the web UI's end-to-end tests.

What I'm still not claiming:

  • Live migration is a beta. The matrix and my own runs are not the same as months in production. If you use it, I'd like to hear how it went.
  • Live migration from MySQL or MongoDB isn't there yet. Both are planned.
  • SQLite → PostgreSQL is implemented and unit-tested, but still has no automated end-to-end coverage.

Thanks

Live migration is the feature I've wanted XferDB to have since the start, because a big migration usually ends up meaning downtime. If you try it, especially on something larger or messier than my test databases, tell me what happened, good or bad.

— Billy

← Back to Home