A near-zero-downtime cloud migration comes down to three things: keep the target database continuously in sync with the source, shrink the cutover to a short write pause you have already rehearsed, and decide in writing beforehand exactly what makes you roll back. True zero downtime is rare; what most teams can realistically achieve is a write pause of seconds to a few minutes with reads still served. The checklist below runs in seven phases, each with items you can tick off and thresholds you can hold people to.
Key takeaways
- "Zero downtime" almost always means "a brief write freeze nobody notices". Plan for that honestly instead of promising the impossible.
- Lower DNS TTLs to 60–300 seconds at least 48 hours before cutover, and keep the old origin able to serve or forward traffic for days afterwards.
- Choose the data-move strategy first. Dump-and-restore, CDC replication and dual-write have very different downtime and risk profiles.
- Do not start cutover unless replication lag has stayed under a stated target (for example, under 5 seconds) for a sustained period.
- Write the rollback trigger down before the night, with a named person who can call it and a time limit.
- Take a verified backup immediately before and immediately after the switch.
This post is the execution checklist. If you are still deciding whether to migrate, which provider to use or what it will cost, start with our practical guide to cloud migration for UK small businesses and come back here once the plan is approved.
What "near-zero" downtime actually requires
Stateless parts (web servers, API containers, static assets) move easily: run both, shift traffic, retire the old one. The hard part is state: the database, uploads, queues, sessions. At some moment the source of truth moves, and for that moment writes must go to exactly one place.
To get that moment down to seconds you need all of the following:
- Continuous replication from the old database to the new one, so the final sync is a few seconds of changes, not hours of data.
- Applications that tolerate a brief read-only period, or a write path that can queue or retry for 30–120 seconds without losing data.
- Configuration that can flip in one step (an environment variable, a connection string, a load balancer target), not a code change.
- Shared state moved out of the old box first: sessions in a shared store, uploads in object storage, scheduled jobs that can be paused.
If any of these is missing, plan a short, announced maintenance window instead. A communicated 20-minute window beats an unplanned four-hour incident.
Choosing a data-move strategy
| Strategy | How it works | Typical write downtime | Main risk | Fits when |
|---|---|---|---|---|
| Dump and restore | Stop writes, export, import, repoint the app | Minutes to hours, growing with data size | Window runs over; no live fallback once writes resume on the target | Small databases (single-digit GB), tolerant users, simple schemas |
| Logical replication / CDC | Initial load, then stream ongoing changes from the source's log (WAL, binlog, transaction log) to the target | Seconds to a few minutes for the final drain | Lag spikes, unsupported types or DDL, sequences and identity values not carried over | Medium to large databases, same or different engines, where the source must stay live |
| Dual-write | The application writes to both old and new stores for a period | Near zero, if done well | Silent divergence when one write fails; hard to reconcile; adds code you must later remove | Rarely the first choice; useful when moving one service's store inside a larger system |
Notes on the middle row, the one most teams end up using:
- Same engine: native logical replication (PostgreSQL publications, MySQL binlog replicas). Across engines, a CDC pipeline reads the source's change log and applies it with type mapping.
- In PostgreSQL logical replication, sequence values are not replicated. Reset sequences on the target to above the source's current maximum as part of cutover, or the first insert after the switch will fail on a duplicate key.
- Schema changes (DDL) are usually not replicated automatically. Freeze schema changes for the whole replication period.
We built our Database Migration Platform around the CDC approach: a bulk load for large tables, then change capture attaching through Debezium and Kafka, with reconciliation that compares row counts and sampled keys between source and target. In one SQL Server to PostgreSQL migration it loaded roughly 780 million rows across 405 tables while the source stayed live, and keeps them in sync, with row counts matching exactly on 384 of 387 measured tables. Whatever tool you use, do not cut over until something other than optimism tells you the two sides match.
The checklist
Print this, assign an owner to each phase, and do not move to the next phase until every box in the current one is ticked.
Phase 1: Inventory (2–4 weeks before)
- Every component listed: apps, databases, queues, caches, cron jobs, file stores, outbound email, webhooks.
- Every inbound integration listed: which partners call you, from where, and whether they allowlist your IP.
- Every certificate, domain and DNS record exported to a file.
- Data sizes and daily write volumes measured per database.
- Current RPO and RTO agreed with the business owner (how much data you may lose; how long you may be down).
Phase 2: Dependency map (2–3 weeks before)
- For each component, list what it calls and what calls it, including hostnames, ports and credentials.
- Every hard-coded IP address found and replaced with a DNS name or service name.
- Shared state identified: sessions, uploaded files, in-memory caches, local disk writes.
- Outbound IP changes flagged to any partner who allowlists you.
On our own infrastructure, a connection pooler that pointed at the database's internal IP address took the CMS down with 500 errors after a routine container restart: the database came back on a new address and the pooler kept dialling the old one. The fix was to address every service by name on a shared Docker network and never by IP. A migration changes every internal address at once; anything wired to an IP breaks on cutover night.
Phase 3: Data sync strategy (1–3 weeks before)
- Strategy chosen from the table above, with the reason written down.
- Initial load completed into the target.
- Ongoing replication running and monitored.
- Replication lag target set, for example under 5 seconds at peak traffic, sustained for 72 hours before cutover.
- Reconciliation script ready: row counts per table plus sampled primary keys and checksums on critical tables.
- Sequence and identity reset steps written as a script, not a note.
Phase 4: Rehearsal (at least once, ideally twice)
- Full cutover run against a staging copy with production-sized data, timed end to end.
- Rollback run as well, also timed. A rollback you have never run is a hope, not a plan.
- Smoke tests scripted: log in, read, write, pay or submit, receive the email, see the webhook land.
- Runbook updated with every surprise from the rehearsal.
Phase 5: Cutover (the day)
At least 48 hours before:
- DNS TTL lowered to 60–300 seconds on every record that will change. The old TTL has to expire everywhere before the new one counts, so lower it at least one full old-TTL period ahead (48 hours covers the common 24-hour default with margin).
- Change freeze in force: no deploys, no schema changes, no config edits from 24–48 hours before until the post-cutover checks pass.
- Backup of the source taken and test-restored.
On the night:
- Announce the start in the agreed channel.
- Confirm replication lag is under target.
- Put the application in read-only mode or pause writes.
- Wait for lag to reach zero, then run reconciliation.
- Reset sequences on the target.
- Flip the connection string or load balancer target, then update DNS.
- Re-enable writes against the target only.
- Run the smoke tests.
- Take a backup of the target in its new state.
Phase 6: Rollback (written before, used only if triggered)
- Written rollback trigger, for example: "If smoke tests fail, or the error rate exceeds 2% for 5 minutes, or reconciliation shows any missing rows on critical tables, we roll back." Pick your own numbers, but write them down.
- Named person with authority to call it, and a decision deadline (for example, 30 minutes after writes resume).
- Reverse path known: if writes have landed on the target, how do they get back to the source? Reverse replication, or a documented manual replay.
- Old environment kept running and untouched until the rollback window closes.
Backups bracket the whole thing. Take one immediately before the write pause and one immediately after writes resume on the target. In our own setup, nightly database dumps go off-host to date-stamped object keys using a write-only credential, so the server being backed up can neither read nor delete them. During a migration more credentials than usual are in play, so keep backups where the migration tooling cannot reach.
Phase 7: Post-cutover (first 7 days)
- Monitoring, alerting and uptime checks repointed at the new environment and confirmed to fire.
- Scheduled jobs running in exactly one place. Two copies of a billing job is its own incident.
- Old origin kept serving, or forwarding to the new one, for at least a week; some resolvers and clients ignore low TTLs.
- Error rates, latency and database load compared with the pre-migration baseline.
- DNS TTLs raised back to normal values once stable.
- Old environment decommissioned only after the rollback window and one full billing or reporting cycle.
The failure mode nobody rehearses: your own tooling
Cutover plans test what users see, rarely the internal jobs that talk to production: link checkers, uptime monitors, backup verifiers.
When we switched on a CDN's bot-challenge mode on our own site, real search engine crawlers carried on through, but our own sitemap checker and link checker started receiving a 403 challenge page. Both kept "running"; neither was checking anything real. Migrations often add a new CDN, WAF or load balancer at the same time, with the same result. The fix was to let internal jobs read from the origin directly. Add a line to Phase 7: confirm every internal job's last result came from the new environment and returned real content, not a challenge page or a cached error.
How long it takes and who you need
Assuming one or two applications, one relational database under a few hundred GB and a handful of integrations: two to six weeks of preparation for one or two engineers, plus a business owner who can make go/no-go calls. Large databases, cross-engine moves and many integrations stretch the preparation, not the cutover. If you want help planning or running one, our cloud solutions and DevOps teams do this work.
Frequently Asked Questions
Is zero-downtime cloud migration actually possible?
For stateless services, yes. For anything with a database it is rare, because writes have to pause briefly while the final changes drain to the new database. With continuous replication and a rehearsed runbook, that pause can be seconds to a few minutes, which most users never notice.
How far in advance should I lower DNS TTL before a migration?
At least as long as the current TTL, and 48 hours is a safe default. Set it to 60–300 seconds on the records that will change, then raise it back once the new environment is stable. Keep the old server forwarding traffic for a while anyway, because some resolvers ignore short TTLs.
What replication lag is acceptable before cutover?
There is no universal number, but a lag that stays under about 5 seconds at peak traffic for several days is a reasonable bar for most business applications. More important than the exact figure is that you set one in advance and don't start cutover while lag is spiking.
What should trigger a rollback during a cloud migration?
Decide before the night. Typical triggers are failed smoke tests, an error rate above a set percentage for a set number of minutes, or reconciliation showing missing rows on critical tables. Name one person who can call it and set a deadline after which you commit to the new environment.
Should I use dual-write or CDC to migrate a database?
CDC or native logical replication is usually safer, because one system, the source database's change log, decides what happened. Dual-write puts that responsibility in application code, where a failed second write can leave the two stores quietly different. Use dual-write only when log-based replication is not available.
Work with Esparks IT Solutions
Planning a project around this? We work with businesses in the United States, Canada and the UAE, as well as the UK and Australia. Explore our Cloud Computing services and portfolio, estimate your project cost, or book a free call.




