A regulated payments company just moved more than 40 TB of production data onto a new EDB Postgres cluster. The cutover started at 2 AM local time. By morning, the application was back online, and the client’s team confirmed in writing that every post-cutover validation check had passed. That night was quiet because of everything that happened in the months before it. In September I wrote about pushing this go-live date back on purpose, and about the playbook we use to de-risk a mission-critical migration. This post is the follow-up. It covers what we learned once the data got big, what actually set the timeline, and what the week after cutover looks like.
The biggest table sets the date
Here’s an important lesson for the project plan. On a large migration, your cutover date is set by your biggest tables. This database had two giants: one table at 8.6 TB and another at 4.5 TB. Everything else was small by comparison. The bulk of the database could sync in days. Those two took weeks, and the cutover couldn’t happen until they were fully caught up. Because of nuances in the specific environment, a dump/restore wasn’t an option. So the date moved. Four times in total. Each move was caused by something new we learned in a rehearsal. We weren’t willing to cut over on a guess. If I could give one piece of advice to anyone planning a migration at this size, it’s this. Size your timeline from your largest table, not from the total. A 40 TB database made of a thousand 40 GB tables is a very different project from one where two tables hold a third of the data. Find your giants on day one, and plan around them. Why waiting was cheap Moving the date four times sounds expensive. In this case it cost almost nothing, and the reason is worth understanding. The data moved through replication while the old system kept serving production. The client’s business carried on as normal the whole time, with no noticeable impact. So every extra week of waiting didn’t cost downtime. It bought more sync, another rehearsal, and more confidence. That’s the real payoff of a replication-based migration. With a dump and restore, waiting means nothing, because the copy only happens during the outage. With replication, the copy happens in the background and the outage only has to cover the last stretch of changes. Time works for you instead of against you. By the final week, the remaining gap on the largest tables came to roughly a week’s worth of changes, around 12 million rows. That’s a small enough slice to carry over in a planned window. That’s what turns a 40 TB migration into a one-night cutover.
Planning a large PostgreSQL migration? Our Forward Deployed Engineers plan and run zero-downtime PostgreSQL migrations end to end, from planning and rehearsals to the cutover and the support that follows. See zero-downtime PostgreSQL migration →
Parallel backfill for the giants A single replication stream copying an 8.6 TB table is slow. Each table’s initial copy runs as one long job, and on a table that size it can run for days. The fix was to split the work. The team broke the backfill of the biggest tables into parallel workers, each handling its own slice, and tracked them separately. Smaller tables finished early and got out of the way. The giants got dedicated workers and a checkpoint call every few days to compare progress against the plan. A few practical things matter when you do this:
Watch WAL on the source. While a long copy runs, the replication slot holds on to write-ahead log until the subscriber confirms it. On a busy primary that adds up fast. Size your disk headroom for the full length of the copy, not for a normal day. And be careful with max_slot_wal_keep_size here. It protects the primary, but if the slot exceeds it mid-migration, the slot is invalidated and that table’s sync starts over. Measure progress, don’t estimate it. On recent Postgres versions, pg_stat_progress_copy shows how far each table’s initial copy has gotten, and pg_stat_subscription and pg_replication_slots show how far behind each subscriber is. Put real numbers in your checkpoint meetings. Plan for what replication doesn’t carry. Logical replication moves table data. On current releases, sequence values aren’t synced automatically, so the runbook needs a step at cutover to bring them across. Schema changes have to be applied on both sides as well.
The calendar outside the database One constraint shaped this project as much as the data did. As a regulated company, the client had to notify their regulator several working days before any production cutover. That turns a small slip into a big one. If the largest table finishes syncing a day late, you don’t lose a day. You lose the window, because the notice has already gone out for a date you can’t meet, and the next window is a month away. The lesson is to build the outside calendar into the plan from the start. Know your notice periods, your change-freeze windows, and the weekends your business can actually take an outage. Then pick candidate dates that leave enough slack for the giants to finish. Treat each date as a target the data has to earn, not a promise. Cutover night is short when the work is done Because the hard work happened beforehand, the night itself followed the runbook. The application team stopped writes, the final changes drained across, the new cluster took over, and the application team ran their tests against it. Nothing about the cutover was heroic, and that was the point. The decisions had all been made in rehearsal. The night was just execution. I always tell my team – strategy trumps valor. The week after cutover A migration isn’t done when the application comes back up. It’s done when the new system has run under real load and stayed healthy. So the client’s team and ours ran a dedicated monitoring week – what we call hypercare – covering:
Replication health on every standby WAL archiving, so backups and point-in-time recovery work from day one Query performance against the old system’s baseline CPU, memory, and disk usage under production load The status of the failover manager and the cluster as a whole
That week earned its keep. Right after cutover, one standby showed replication lag. Because someone was watching for exactly that, it was caught early, worked through, and brought back in sync, with no effect on production. If that lag had gone unnoticed, the first anyone heard of it might have been a failover to a standby that was behind. Build the monitoring week into the plan, with names against each item. It’s the cheapest insurance you’ll buy on the whole project.
Webinar on 16 December: Life After PostgreSQL 14 Semab Tariq, our Delivery Manager, shows how to move to PostgreSQL 18 with logical replication while the current cluster keeps serving production, covering rehearsals, very large databases, sequences and a week of hypercare after cutover. 16 December 2026, 3:00 pm GMT. Register for the webinar →
What to take into your next migration If you’re planning a large Postgres migration, here’s the short version:
Find your biggest tables first. They set the timeline. Use replication so that waiting costs you sync time, not downtime. Split the giants across parallel workers, and measure their progress with real numbers. Size WAL headroom on the source for the full length of the copy. Put regulatory notice periods and change windows into the plan from day one. Treat the week after cutover as part of the migration, not as an afterthought.
For a business that runs on its database, a boring cutover protects revenue, customer trust, and your standing with the regulator. It isn’t luck. It’s the result of letting the data set the pace. FAQ How long does it take to migrate a 40 TB PostgreSQL database? The cutover itself can be a single night. The preparation takes weeks or months, and the timeline is set mostly by the largest tables. Two tables holding several terabytes each can take far longer to sync than the rest of the database combined. How do you migrate a very large PostgreSQL table without downtime? Use replication to copy it in the background while the source keeps serving production. For very large tables, split the initial copy across parallel workers. At cutover, only the changes made since the last sync have to carry over, which keeps the outage short. What should you monitor after a database cutover? Replication health on every standby, WAL archiving, query performance against your baseline, resource usage under load, and the status of your failover tooling. Plan at least a week of active monitoring, with owners named for each item. Why does logical replication fill up disk on the source? A replication slot keeps write-ahead log until the subscriber confirms it has received it. During a long initial copy, that WAL accumulates. Size disk headroom on the source for the full copy duration, and watch slot lag closely. Does logical replication copy sequences? On current releases, sequence values aren’t synced automatically. Your cutover runbook needs a step to set sequences on the target to the right values before the application starts writing.
Talk to us before your next big cutover Tell us about your database, your deadlines and your constraints, and our engineers will help you plan a migration that lets the data set the pace. Talk to a PostgreSQL expert →
The post How a 40 TB PostgreSQL Cutover Took One Night appeared first on Stormatics.






