Your Migration Rollback Plan Is Probably Wishful Thinking. Here's What a Real One Looks Like | PulseSoft
Skip to content

Your Migration Rollback Plan Is Probably Wishful Thinking. Here's What a Real One Looks Like

PulseSoft Team · · 12 min read

Introduction

The rollback section in most migration runbooks is the shortest section in the document. It typically reads something like: "If issues are encountered, revert DNS to point to on-premises environment and assess." That's not a rollback plan. That's a hope that reverting DNS solves whatever went wrong, which it might, if the only thing that's wrong is that traffic is going to the wrong place. It doesn't help if the database has been migrated and written to, if a schema migration has run, if the on-premises application configuration has been changed to point to AWS endpoints, or if the maintenance team has already decommissioned the original infrastructure.

A cloud migration rollback plan is a complete, tested procedure for returning a system to its pre-migration state, or to a known-good intermediate state, from any point in the migration sequence at which a rollback might be needed. It requires understanding what's reversible, what's irreversible, and where the point of no return is: the moment in the migration sequence after which rollback is no longer possible without data loss or extended downtime.

Most migration teams know where their point of no return is in theory. Very few have tested whether they can actually execute a rollback from just before that point.


Why Rollback Plans Fail When You Need Them

The asymmetry between migration planning and rollback planning is almost universal. Migration plans get detailed runbooks, rehearsals, and careful sequencing. Rollback plans get a paragraph and an assumption that the on-premises environment will still be in the state it was in at migration start.

That assumption is the core failure. By the time a team decides to roll back, the environment has changed in ways the rollback plan didn't account for:

The on-premises application has been reconfigured. Connection strings, environment variables, and configuration files were updated to point to AWS endpoints as part of the migration procedure. Rollback requires reversing these changes, which means having a snapshot of the original configuration, not just the ability to change DNS.

The database has new writes. If traffic reached the AWS environment for any period before the rollback decision, the AWS database has writes that don't exist in the on-premises database. Rollback that simply re-points to the on-premises database abandons those writes, potentially transactions, potentially user data.

The on-premises environment was modified to prepare for the migration. Firewall rules changed, services stopped, read-only mode enabled. The on-premises environment that rollback is supposed to return to may not be the environment that existed before migration day.

The on-premises infrastructure has already been decommissioned. In migrations with a tight timeline, some teams begin decommissioning on-premises resources within hours of a "successful" migration, before the application has been running long enough to confirm it's truly stable. A rollback decision on day two hits an on-premises environment that no longer exists.

The concrete example: a retail client migrated their order management system to AWS on a Saturday night. By 10am Sunday, the migration appeared successful, and the ops team began shutting down on-premises servers to reclaim rack space. At 2pm Sunday, a critical batch processing failure was discovered in the AWS environment: the batch processor had a dependency on a shared file path that didn't exist in AWS. The rollback decision came at 3pm. The on-premises servers were halfway through decommissioning. Rollback required rebuilding two servers from backup, restoring the batch processor configuration, reconciling eight hours of writes between the AWS database and the on-premises database, and running the batch jobs manually for the data that had accumulated. Total recovery time: nine hours. A rollback plan that accounted for this scenario would have specified a 48-hour hold on on-premises decommissioning.


AWS Deep Dive: Rollback Mechanics by Migration Type

DNS Rollback: The Fast Path and Its Limits

DNS rollback, changing a DNS record to point back to the on-premises IP, is the fastest rollback mechanism for most application tiers, but it has specific limitations that the migration plan needs to account for.

Speed: With TTLs pre-reduced to 60-300 seconds (per the preparation guidance), DNS rollback takes effect within 5 minutes for most clients. The rollback action is a single Route 53 API call:

# Rollback: repoint to on-premises IP
aws route53 change-resource-record-sets \
  --hosted-zone-id Z1234567890 \
  --change-batch '{
    "Changes": [{
      "Action": "UPSERT",
      "ResourceRecordSet": {
        "Name": "api.yourcompany.com.",
        "Type": "A",
        "TTL": 60,
        "ResourceRecords": [{"Value": "203.0.113.10"}]
      }
    }]
  }'

# Verify propagation from multiple locations
for region in us-east-1 eu-west-1 ap-southeast-1; do
  echo "Checking from $region..."
  aws route53 test-dns-answer \
    --hosted-zone-id Z1234567890 \
    --record-name api.yourcompany.com \
    --record-type A \
    --region $region
done

Limitations: DNS rollback re-routes new connections. It does not affect:

  • Existing connections that were established before the DNS change and are still open
  • Clients that have cached the DNS response and haven't expired their cache yet
  • Application servers that resolve DNS once at startup and cache the IP internally

For long-lived connections (database connections, WebSocket connections, keep-alive HTTP connections), DNS rollback may not fully re-route traffic for minutes to hours after the record change. The migration plan needs to account for connection draining, actively closing existing connections to force clients to re-resolve DNS and connect to the on-premises environment.

The non-obvious Route 53 behavior that affects rollback: if you're using alias records (Route 53 A records that point to AWS resources like ALBs or CloudFront distributions), the rollback requires changing to a standard A record pointing to the on-premises IP. Alias records can only point to AWS resources. This change must be planned in advance, attempting to change an alias record back to a standard IP record under pressure during a rollback adds complexity and risk to an already stressful procedure.

Database Rollback: The Hard Part

Database rollback is where most migration rollback plans silently assume a best case that rarely exists. The patterns depend on whether data has been written to the AWS database since migration start.

Scenario 1: No writes to AWS database (rollback before traffic shifted) If the rollback decision is made before any traffic reached the AWS environment (before DNS was changed, before load balancer targets were updated), the AWS database has no data that doesn't exist in the on-premises database. Rollback is simply a matter of not switching traffic. The on-premises environment is unchanged and ready to receive traffic.

Scenario 2: Writes to AWS database with DMS ongoing replication running AWS Database Migration Service (DMS) supports change data capture (CDC), continuous replication of changes from the source database to the target. If DMS is running bidirectionally or can be reversed, writes to the AWS database during the migration window can be replicated back to the on-premises database before rollback.

This requires advance setup: the on-premises database must be configured as a DMS target, not just a source. Most migration DMS setups replicate source (on-premises) → target (AWS) only. Setting up reverse replication is additional complexity, but it's the only mechanism for zero-data-loss rollback after writes have reached the AWS database:

# Verify DMS replication task status before rollback decision
aws dms describe-replication-tasks \
  --filters "Name=replication-task-id,Values=prod-migration-task" \
  --query 'ReplicationTasks[0].{Status:Status,StopReason:StopReason,ReplicationLag:ReplicationTaskStats.TablesLoaded}'

# If CDC is running, check replication lag before stopping
aws dms describe-table-statistics \
  --replication-task-arn arn:aws:dms:us-east-1:123456789012:task:abc123 \
  --filters "Name=schema-name,Values=prod" \
  --query 'TableStatistics[*].{Table:TableName,Inserts:Inserts,Updates:Updates,Deletes:Deletes,AppliedInserts:AppliedInserts}'

Scenario 3: Writes to AWS database, no reverse replication, schema migrations have run This is the point-of-no-return scenario. If writes have been made to the AWS database and a schema migration (ALTER TABLE, new tables, column changes) has run against the AWS database, changes that can't be replicated back to the on-premises database because the schema no longer matches, rollback without data loss is not possible. The migration plan needs to explicitly identify this moment and document what "rollback" means here: accepting data loss, reconciling differences manually, or accepting that rollback is not available and the team must resolve the issue in the AWS environment.

ALB Target Group Rollback for Weighted Traffic

For migrations that use weighted routing to shift traffic gradually (routing 10% to AWS, then 25%, then 100%), rollback at any stage is as simple as resetting the weights:

# Roll back from 25% AWS traffic to 0% by removing AWS targets
aws elbv2 modify-rule \
  --rule-arn arn:aws:elasticloadbalancing:us-east-1:123456789012:listener-rule/abc123 \
  --actions '[{
    "Type": "forward",
    "ForwardConfig": {
      "TargetGroups": [
        {
          "TargetGroupArn": "arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/on-prem/abc123",
          "Weight": 100
        },
        {
          "TargetGroupArn": "arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/aws/def456",
          "Weight": 0
        }
      ]
    }
  }]'

This is the preferred rollback mechanism when it's architecturally possible because it's instantaneous (no DNS propagation delay), it's specific to the load balancer (not dependent on client DNS cache behavior), and it's independently reversible at any traffic percentage. The limitation: it requires both the on-premises environment and the AWS environment to be behind the same ALB, which requires either a VPN/Direct Connect connection or a migration architecture where the ALB serves as the traffic control plane from the start.

Rendering diagram…

Enjoying this so far?

Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.

No spam. Unsubscribe anytime.

Tradeoffs & Decision Framework

Rollback planning exists on a spectrum from "simple DNS revert" to "full bidirectional replication with reconciliation procedures." The right depth depends on the cost of data loss and the cost of extended downtime.

When simple DNS rollback is sufficient:

  • Stateless applications with no persistent data (static websites, caching layers, read-only API consumers)
  • Applications where the database is migrated separately and is not in scope for this rollback
  • Applications where the maintenance window is short enough that no meaningful user data is generated during the window

When database rollback planning is required:

  • Any migration where user-generated data (transactions, user accounts, orders, records) is written during the migration window
  • Applications with compliance requirements for data completeness (HIPAA, PCI DSS, SOX)
  • SaaS applications where data loss directly translates to customer-reported data inconsistency

When rollback is not a viable option (and the plan must say so explicitly):

  • Migrations involving irreversible data transformations (ETL processes that don't preserve the original format)
  • Migrations where the on-premises infrastructure has been decommissioned as part of the migration
  • Database migrations where schema changes are applied that are incompatible with the previous application version

The explicit "rollback not available" designation in a migration plan is uncomfortable but essential. Teams that don't acknowledge the point of no return in their migration plan discover it accidentally, usually when someone asks "can we roll back?" during a failing migration and the honest answer is "not without losing the last six hours of data."

A rollback plan that says "we cannot roll back after step 8 without data loss; the resolution path if step 8 onwards fails is X" is more useful than a rollback plan that implies rollback is always possible.


Lessons From the Field

1. "Revert DNS" is not a rollback plan. It's one step of a rollback plan. Every rollback has three components that all need to be documented: re-routing traffic (DNS or load balancer), restoring application configuration (connection strings, environment variables, config files that were changed), and addressing database state (what data exists in AWS that doesn't exist on-premises, and what to do about it). A rollback plan that only addresses traffic routing leaves the other two components as improvised responses during the highest-stress moment of the migration.

2. The on-premises environment must be actively maintained in rollback-ready state throughout the migration window. At a fintech client, the on-premises database was put into read-only mode at migration start to prevent write conflicts. Four hours into the migration, the team decided to roll back, and discovered that returning the on-premises database to read-write mode required a DBA action that took twenty minutes, plus fifteen minutes of application configuration changes, plus ten minutes of validation. The actual rollback window was forty-five minutes, not the fifteen minutes the runbook said. The "actively maintained" state means: tested that the environment can receive traffic, not just that it exists.

3. Set a decommissioning hold period in the migration plan, not as an afterthought. On every migration engagement, I write a decommissioning hold period into the migration plan before migration day, typically 48-72 hours for non-critical applications, 7-14 days for revenue-critical systems. The hold is explicit: no on-premises resources are decommissioned until the hold expires and the application has been running stably in AWS. This one clause has prevented rollback nightmares on two engagements where issues surfaced within 36 hours of migration and the on-premises environment was still fully intact.

4. Partial rollback is sometimes the right answer, and the plan needs to account for it. Managed a migration at a logistics client where the application tier migrated cleanly but the batch processing component failed. The rollback decision for the batch component was independent of the rollback decision for the application tier: the application was healthy and should stay in AWS; only the batch component needed to roll back. The rollback plan had only been written for whole-system rollback. Executing a partial rollback required improvisation that extended the resolution time by two hours. Write rollback plans for each major component independently.

5. The rollback decision authority must be named in the plan, not described by role. A migration rollback decision is sometimes the right call and sometimes the wrong call, and different stakeholders will have strong opinions under pressure. The migration plan needs to name a specific individual, not "the infrastructure lead" but "Jane Smith", who has unilateral authority to call the rollback if the criteria are met. No committee decision under stress. The named individual calls it, the team executes, the debrief happens afterward.


Final Thoughts

The rollback plan is the document that gets tested first when a migration fails, and it's the document that gets the least attention during migration planning. That inversion, investing heavily in the plan that assumes success and minimally in the plan that assumes failure, is a consistent pattern in migration projects, and it produces consistent outcomes when something goes wrong.

The teams that execute successful migrations treat the rollback plan with the same rigor as the migration plan: the same level of detail, the same rehearsal cadence, the same definition-of-done. They know their point of no return. They've tested whether they can actually execute the rollback from just before that point. They've maintained the on-premises environment in rollback-ready state throughout the migration window. And they've named the individual with authority to call it.

Cloud migration rollback planning is not pessimism. It's the confidence that comes from knowing exactly what you'd do if things went wrong, which, paradoxically, is what makes things less likely to go wrong. Teams that have thought through the failure path in detail are the teams that catch problems early, make the rollback call at the right moment, and recover cleanly when they do.


Key Takeaways

  • "Revert DNS" is one step of a rollback plan, not the whole plan. A complete rollback addresses three components: traffic re-routing, application configuration restoration, and database state. Plans that only address traffic routing leave the other two as improvised responses under pressure.
  • The point of no return must be explicitly identified and documented. The moment in the migration sequence after which rollback without data loss is not possible needs to be named, communicated to all stakeholders, and treated as a decision gate: not discovered accidentally when someone asks if rollback is still possible.
  • Alias records in Route 53 cannot point to on-premises IPs. A rollback from an alias record (pointing to an ALB or CloudFront distribution) to an on-premises IP requires changing to a standard A record. This must be planned in advance and scripted for execution under pressure.
  • Database rollback after writes requires either DMS reverse replication or accepting data loss. Set up DMS CDC bidirectionally if zero-data-loss rollback is required after writes reach the AWS database. If reverse replication is not in scope, the migration plan must explicitly document that rollback after this point involves data loss.
  • The on-premises environment must be actively maintained in rollback-ready state throughout the migration window. Read-only mode, stopped services, and changed firewall rules extend rollback time beyond what the plan assumes. Test a full traffic switch to the on-premises environment before migration day, from the exact state it will be in during the migration.
  • Set a decommissioning hold period in the migration plan before migration day. 48-72 hours for non-critical systems, 7-14 days for revenue-critical ones. No on-premises resources are decommissioned until the hold expires and the application has been stable in AWS for the full hold period.
  • The rollback authority must be a named individual, not a role or a committee. One person with unilateral authority to call the rollback when criteria are met. Committee decisions under stress produce delays; delays extend outages. Name the person before migration day.

Get insights like this in your inbox

Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.

No spam. Unsubscribe anytime.