The Wild

Zero Downtime Migration: Production Checklist

· 6 min read · Mammals

In this article
  1. Why Zero Downtime Migrations Fail
  2. Core Principles of Zero Downtime Migration
  3. The Production Migration Checklist
  4. Choosing the Right Migration Strategy
  5. Common Pitfalls and How to Avoid Them
  6. Costs and Trade-offs
  7. Safety and Accuracy Considerations
  8. Frequently Asked Questions

Zero downtime migration is achievable, but only with a production-grade checklist that covers pre-migration validation, cutover rehearsals, rollback triggers, and post-migration verification. The checklist below is the operational backbone for moving live systems without interrupting service, and it applies to databases, applications, or entire infrastructure stacks.

Why Zero Downtime Migrations Fail

Most failed zero-downtime migrations aren't caused by the migration tool itself—they fail because of overlooked dependencies, unvalidated rollback paths, or incomplete data consistency checks. For example, a database migration might succeed at the storage layer but break application connections because the connection string wasn't updated in a configuration service. Another common failure is assuming a replica is fully caught up when it's actually lagging by several seconds, causing data loss during the final cutover. The root issue is usually that the team treated the migration as a single event rather than a series of controlled, reversible steps.

Core Principles of Zero Downtime Migration

Three principles underpin every successful zero-downtime migration:

  • Dual-run capability: The old and new systems must run simultaneously, with the ability to route traffic to either at any time.
  • Data synchronization: Continuous or near-continuous sync between old and new data stores, so the new system is always ready to take over.
  • Reversible cutover: Every step must have a documented rollback that returns to the previous state without data loss or corruption.

These principles apply whether you're migrating a PostgreSQL database, a Kubernetes cluster, or a monolithic application to microservices. If any one of them is missing, you're not doing a zero-downtime migration—you're doing a risky cutover.

The Production Migration Checklist

Use this checklist as a starting point, adapting it to your specific stack and risk tolerance.

  1. Inventory all dependencies: List every service, database, cache, queue, and external API that the system touches. Include network paths, DNS entries, and firewall rules.
  2. Define success criteria: Write down what “done” looks like—e.g., “all read/write traffic on the new system, zero data loss, response times within 5% of baseline.”
  3. Set up the target environment: Provision the new infrastructure with the same or better capacity. Configure monitoring, logging, and alerting from day one.
  4. Establish data replication: Use a tool like AWS Database Migration Service, pglogical, or a Kafka-based CDC pipeline to keep the target in sync with the source. Verify lag is consistently near zero.
  5. Test the cutover process: Run a full rehearsal in a staging environment that mirrors production. Include a simulated failure to test rollback.
  6. Prepare rollback triggers: Decide in advance what conditions will trigger a rollback (e.g., error rate > 1%, data divergence > 0.1%, latency spike > 2x).
  7. Schedule the cutover window: Even with zero downtime, choose a low-traffic period for the final switch to reduce blast radius if something unexpected happens.
  8. Execute the cutover: Switch traffic gradually—use a load balancer to shift 10% of traffic, monitor, then 50%, then 100%.
  9. Verify and monitor: After full cutover, run integrity checks, compare data hashes, and monitor error logs for at least 24 hours.
  10. Decommission the old system: Only after a stable period (e.g., a week) should you remove the old system. Keep it as a fallback until then.

Choosing the Right Migration Strategy

Your choice of strategy depends on your system's architecture and tolerance for risk. The most common approaches are:

  • Blue-green deployment: Run two identical environments (blue = old, green = new). Switch the router from blue to green once green is fully validated. This is ideal for applications but requires data sync if the database changes.
  • Rolling migration: Update instances one by one, keeping the rest serving traffic. Works well for stateless services but not for databases with schema changes.
  • Parallel run with shadow reads: Send a copy of production traffic to the new system while serving users from the old one. Compare results to catch logic errors. This is powerful for data-heavy migrations.
  • Dual-write with backfill: Write to both old and new databases for a period, backfill historical data, then switch reads. This is common for major database migrations.

There's no one-size-fits-all; a hybrid approach often works best. For example, a blue-green deployment for the app layer combined with dual-writes for the database.

Common Pitfalls and How to Avoid Them

Even with a checklist, teams trip on the same issues repeatedly:

  • Schema drift: The new database schema isn't exactly what the application expects. Use automated schema comparison tools and test against the actual application version.
  • Replication lag: During cutover, the replica might be behind by seconds. Use a tool that can pause writes and verify lag is zero before switching.
  • Ignoring non-functional requirements: The new system might be functionally correct but slower. Load test with production-like traffic before cutover.
  • No rollback plan for the rollback: If you roll back, you need to reverse the data sync without losing new writes. Plan for that in advance.
  • Forgetting external dependencies: A payment gateway or third-party API might not be compatible with the new system. Test all integrations early.

Costs and Trade-offs

Zero downtime migration is not free. You'll need to run two environments simultaneously, which doubles infrastructure costs for the duration. Data replication tools and additional monitoring also add expense. The trade-off is avoiding revenue loss from downtime and the reputational damage of a service outage. For a business that earns $10,000 per hour, a 2-hour downtime costs $20,000—often more than the extra infrastructure. However, for a small internal tool with no users, a scheduled maintenance window might be more cost-effective. Always calculate the cost of downtime versus the cost of dual-running.

Safety and Accuracy Considerations

Data integrity is the highest priority. Before cutover, verify that the new system has exactly the same data as the old one. Use checksums or row counts on critical tables. During the migration, never assume—verify. If you're migrating a database that contains personal data, ensure compliance with data protection regulations (e.g., GDPR) by encrypting data in transit and at rest. Also, have a communication plan: inform stakeholders about the migration window, even if it's zero-downtime, so they know what to expect. Finally, never skip the rehearsal. A dry run in staging catches 90% of issues before they hit production.

Frequently Asked Questions

Can I do a zero downtime migration without a load balancer?

Technically yes, but it's risky. Without a load balancer, you'd have to change DNS, which propagates slowly and can cause a mix of old and new traffic. A load balancer gives you instant control over traffic distribution, which is essential for gradual cutover and rollback.

How long should I keep the old system after migration?

At least one full business cycle—typically a week—to cover any issues that only appear under real traffic. For databases, keep the old system until you're confident no data divergence exists. Some teams keep it for a month for safety.

What's the difference between zero downtime and lossless migration?

Zero downtime means no interruption to service. Lossless means no data is lost. You can have zero downtime but still lose data if replication lags. A true zero-downtime migration is both lossless and uninterrupted.

Is zero downtime migration possible for a monolith?

Yes, but it's harder. You can use a strangler pattern: gradually replace parts of the monolith with new services while routing traffic. The key is to keep the monolith and new services sharing the same database, or use a migration layer that syncs both.

What if replication fails during the cutover?

That's exactly why you have a rollback plan. If replication fails, stop the cutover, revert traffic to the old system, and investigate the cause. Never try to fix replication in the middle of a cutover—it's too risky.