Data Migration Reconciliation and Cutover
A fictional telecom moved its first customer cohort to a new billing system on a Saturday night. The migration log was green, and the row count was 41,306,118 on the source and 41,306,118 on the target. On the following Friday, the month-end revenue report came in eleven thousand lower than finance’s independently prepared figure. It took four days to find a currency conversion error affecting one of the cohort’s three tariff plans: its amounts had been divided by 100 twice. A source amount of 10,000 minor units should have become 100 major units; it became 1. A sixth of the rows used that faulty mapping. The counts alone had established neither key completeness nor value accuracy. When the discrepancy first surfaced that Friday, the finance director asked to return to the old system. The team had only Saturday’s standalone backup and no tested way to recover the intervening six days of orders, payments, and address changes onto the source. There was a backup, but no prepared return procedure.
The team had treated equal counts as evidence that all records arrived, chosen its go decision from the absence of logged errors, and left recovery until an incident. This article examines how reconciliation and business tests support a migration decision, how writes are handed over, and what a usable return path requires. It also covers when the source can be retired: after its remaining dependencies and recovery obligations are resolved. The seams and transitional components that let two systems run together are the subject of Twenty-Three Adapters and No Retirement Dates; here the question is what evidence supports moving live work across them.
What correct means, and what the checks establish
Google’s database migration guide describes consistency in terms of completeness, absence of duplicate data, and preservation of change order. For an implementation, specify the boundary of each property. Retried delivery can be acceptable if each logical operation has the intended effect without overwriting newer state. Ordering must preserve the dependencies required by the key, transaction, and business contract; independent streams do not necessarily require one global order. Source and target should agree under the approved transformation, filtering, and meaning of the data, rather than necessarily contain identical raw rows. Reconciliation compares that defined relationship at an aligned snapshot or applied source position. The checks below cover different failure modes; none proves correctness outside its stated inputs, fields, and acceptance criteria.
| Layer | What is compared | What it catches | What it misses | The telecom |
|---|---|---|---|---|
| Counts and keys | Counts per table and partition; source and target key sets at the same comparison point | Count differences; key comparison identifies missing and unexpected records | Equal counts can conceal different keys; matching keys do not establish correct values | Only counts were checked. Key completeness remained unverified |
| Values and checksums | Canonical values by key, compared in full, through hashes, or on a justified sample | Mapping, truncation, and precision errors in the compared values | Sampling can miss affected rows; hashes can collide; all methods miss excluded fields or shared errors in the comparison specification | A correct expected conversion and comparison covering the third tariff plan would have exposed the double division |
| Business metrics | Independently computed revenue by plan, open balance, and active subscribers under agreed definitions | Differences in the selected figures beyond their accepted tolerances | Offsetting errors, differences within tolerance, and fields no selected metric uses | The month-end comparison detected the difference after cutover |
| Behavior | Known inputs and expected outcomes; end-to-end workflows, integrations, and performance objectives | Incorrect execution semantics and behavior covered by the tests | Unexercised paths and unrepresented workloads | No test covered the third planโs currency conversion |
Cartwright, Horn, and Lewis describe parallel running as useful for critical reports whose figures the business needs to trust. They also warn that legacy reports can contain undiscovered bugs. A mismatch is therefore a starting point for investigation: align the inputs, cutoff, configuration, and intended definitions before deciding whether either implementation is wrong. Known-input tests with independently reasoned expected results and calculation traces can identify the cause; a third running system is not a prerequisite. Finance’s own number is useful when its scope and definition match the comparison. Agree the metrics, tolerances, and accountable approver before cutover, and record any accepted difference with its rationale. A parallel run repeats these comparisons on live work over a defined period. Under the coexistence contract, assign authority for each record or action and isolate payments, notifications, and other side effects on the comparison path so running both implementations does not perform the business action twice.
Choosing the moment: draining and the decision
For the single-writer database cutover considered here, live work moves only after the initial copy and continuing changes have reached the target. Google’s guide calls the final transfer of remaining changes draining. The handoff from initial copy to continuing migration first needs a consistent snapshot tied to a recoverable change-stream position. PostgreSQL’s exported logical-decoding snapshot is one concrete mechanism: the snapshot represents the state before the changes included in the associated stream. Recording the clock time before a scan is not, by itself, an equivalent guarantee for every database or connector. Retain the necessary logs, account for transactions that commit across the boundary, and define overlap handling. Replay safety requires idempotency for the logical operation, together with ordering or version checks that preserve newer state; an identifier alone does not establish those conditions.
At the final handoff, fence every source writer, including jobs and administrative tools, and resolve in-flight transactions. Record the final committed positions for every stream in scope, then verify durable target application through those positions and investigate outstanding errors. Google’s last-insert example can serve as a completion barrier only where the marker cannot become visible ahead of the changes it represents. With parallel tables, partitions, or apply workers, one marker can arrive while another path is still behind. Use the migration system’s supported barriers or per-stream progress checks, backed by final reconciliation at the agreed boundary. Waiting an hour supplies none of that evidence.
In Google’s stop, drain, and reconnect procedure, database writes pause while ownership changes. That pause should be distinguished from the interruption users observe: buffering and retries may keep requests within a service objective, or they may turn the pause into excessive latency and failed requests. Measure both. Read-only tests can run on the target in advance, and reducing outstanding changes shortens the final drain. Budget the remaining functional checks, client reconnection, and recovery time explicitly. A target backup before production access establishes a recoverable starting point; it does not by itself protect writes accepted afterward. Apply the agreed go/no-go criteria after rehearsal, with a named decision owner.
| Decision point | Evidence required | Who decides | If it fails |
|---|---|---|---|
| Go to drain | Lag within its bound; checks passed at the aligned pre-cutover point; writer inventory and step recovery procedure rehearsed | The named cutover owner | Stop before fencing if possible; otherwise use the tested source-resumption procedure and account for any interruption or changed configuration |
| Go to switchover | Source writers fenced and transactions resolved; all final positions durably applied; final reconciliation and basic tests passed; target backed up; recovery within its budget | The same owner | Keep target business writes disabled. Resume the source only after verifying its state, routing, and exclusive write authority |
| Declare stable | Agreed business cycles and workloads checked; no unexplained differences; performance within objectives | The business owner with the cutover owner | Use the approved incident recovery path. Keep reverse synchronization only for the defined fallback window, and identify the recovery path after that window |
| Retire the source | The retirement conditions below | The system owner | Keep the source, with a date for the next check |
Google’s migration-plan guidance recommends a tested rollback strategy and maximum execution time for each step, while warning that disruptive steps can cause losses even after reversal. Give each step a recovery decision at its time limit: undo a reversible change, stop safely, or invoke the approved repair procedure. An operation that drops required data cannot become reversible merely by being placed before client switchover. Even resuming an intact source has an interruption cost. Record irreversible effects and a safe stopping point before executing them, rather than promising that the first rows of the table are free to undo.
Fallback is a migration in reverse
A migration fallback returns clients to the source with the target-side changes required by the agreed recovery contract. Google’s guide treats it as a reverse migration because problems may emerge only when a later business cycle exercises a feature. Prepare capture of target changes before the first production target write, and maintain a tested path for applying them to the source throughout the fallback window. When returning, fence target writers, resolve in-flight work, drain through the final positions, reconcile, and only then transfer write authority and client traffic. Ensure that the old application and its dependencies can use the returned state.
Reverse compatibility is a design requirement. A forward aggregation or lossy conversion may remove information needed by the source. Preserve the required detail, provide an adapter, restrict target-only features during the fallback window, or change the migration scope. If required data or business meaning cannot be represented, the proposed fallback is not ready; any permitted loss needs explicit scope and approval. Old clients need to support the promised recovery behavior, which does not always mean copying every target implementation change. Returning traffic also must not duplicate a payment or notification already performed on the target. Rehearse the data transfer, authority change, client behavior, and handling of external effects as one recovery procedure.
| Way back | What it restores | What it loses | When it is enough |
|---|---|---|---|
| Rollback of a step | A compatible prior version or configuration within the stepโs tested recovery scope | May leave interruption, changed data, or external effects that need separate repair | When that step is reversible and the retained state remains compatible, whether before or after target writes begin |
| Backup-based recovery | Retained state, potentially advanced with compatible logs or other replayable records | Changes beyond the recoverable position; a standalone snapshot has no later changes | When the retained material, replay, validation, and client recovery meet the required objectives; it can be part of a return procedure |
| Fallback | Source service and clients with the required target changes reconciled back | Reverse-drain interruption and only explicitly accepted losses; unrepresentable required data blocks approval | When the tested reverse path meets the recovery contract during its supported window |
A backup is recovery material; a fallback is an operational procedure. PostgreSQL’s point-in-time recovery, for example, combines a compatible base backup with archived WAL to recover later state. That does not mean logs from an arbitrary target can be replayed into a different source engine. The telecom had only a standalone Saturday copy, so it could not reconstruct the following six days on the old system. A fallback can use backup-based reconstruction when that complete procedure is compatible, tested, and fast enough. Its label is less important than the state and service it actually recovers.
Choosing not to provide a fallback requires more than accepting a predicted forward-fix duration. Record the interruption objective, permitted data loss, possible incorrect business actions, alternative recovery path, and uncertainty in how long repair will take. A tested target restore and replay may satisfy those requirements. If neither forward recovery nor a feasible reverse path does, defer the switch or redesign its scope. Rehearse the chosen recovery procedure. Where fallback is provided, state its end condition and the recovery arrangements that take over afterward; a return rehearsal is not mandatory for a deliberately excluded return path.
Switching the old system off
Retire the source when its operational, comparison, and recovery roles have ended. Google’s migration-plan guidance includes successful transfer of workloads and their protection mechanisms, usable data meeting the defined accuracy standard, target performance and monitoring, and removal of dependencies on source resources. Dependencies outside the migration scope must also be resolved before shared resources are removed. A completed fallback window is one condition where such a window was adopted; elapsed time alone is insufficient. The database guide recommends a final backup as an accessible end state. Its retention, access, and eventual disposition must follow the applicable policy. The system retirement entry covers accounts, credentials, jobs, licenses, and routes; a retention schedule governs records that must remain accessible, with retrieval tested before the old access path disappears.
GOV.UK’s service-retirement guidance also addresses the people who use a service: determine how their needs will be met, tell them what changes, and give API consumers time to update their software. Its redirect and SSL requirements are specific to GOV.UK services, with a defined duration based on how long the service was live. Other organizations need their own supported-address and redirect policy. Verify that legitimate consumers have moved and that no required workload still depends on the retired backend; do not require every bot or obsolete bookmark to stop requesting the old address. A redirect can remain active after the backend retires. Keep its certificate valid while it serves HTTPS, and plan its eventual closure separately. Retained data continues to need authorized access and protection after application retirement.
Judging a cutover plan
A reviewable cutover plan identifies what each comparison establishes, its reference boundary, and its acceptance criteria. It connects writer fencing and final applied positions to the authority switch, rather than relying on elapsed time or an unqualified marker. Each step has an owner, a time limit, and a tested recovery or safe-stop procedure, with irreversible effects disclosed. The selected incident recovery path has been rehearsed by its operators; if it includes fallback, the plan names its compatibility conditions and supported window. Retirement depends on resolved consumer and recovery obligations and tested access to retained records. Matching counts, a clean migration log, and a backup are useful evidence within their scopes, but none alone establishes that the move is correct or recoverable.
What a reviewer should ask
- What is the reference for each reconciliation layer, and what is its cutoff?
- Which business figures must agree, computed how, within what tolerance, and who owns each?
- How are source writers fenced, and how is durable application through every final source position verified within the interruption budget?
- For each step, what is the time limit and tested recovery or safe-stop procedure, and what effects cannot be undone?
- Which recovery path is rehearsed, what interruption and data loss are accepted, and what happens after any fallback window ends?
- If fallback is provided, can the source and old clients represent the required state and behavior throughout its supported window?
- What are the conditions for retiring the source, and which of them are measured rather than asserted?
- Who consumes the old system’s outputs, and has each been told?
For the remaining customer cohorts, the telecom compared aligned snapshots and found two more mapping errors before cutover. Finance approved five metrics and their tolerances. Both systems produced the figures through three month-end closes; one alert exposed an old rounding rule. Finance approved the corrected rule, documented the expected difference, and retained an alert for deviations beyond it.
Before each authority switch, the team fenced the relevant source writers and verified every final applied position as well as the reconciliation results. Reverse synchronization and compatible old clients remained available through the three-close validation period. Before production cutover, an isolated representative rehearsal exercised the return procedure in forty minutes; subsequent material changes required revalidation.
The team closed the fallback window only after accepting the validation results and the target recovery plan. It retired the source in the fourth month, after verifying that report consumers and jobs had moved and that the retained archive was retrievable under its policy. These checks supported acceptance of the defined scope. Future workflows still needed validation against their own inputs and acceptance criteria, using the same discipline for reconciliation, authority, and recovery.
References:
- Google Cloud Architecture Center: Database migration: Concepts and principles (Part 1) (CC BY 4.0).
- Google Cloud Architecture Center: Database migration: Concepts and principles (Part 2) (CC BY 4.0).
- Google Cloud Architecture Center: Migrate to Google Cloud: Best practices for validating a migration plan (CC BY 4.0).
- Ian Cartwright, Rob Horn, and James Lewis: Divert the Flow (2022).
- GOV.UK Service Manual: Retiring your service (Open Government Licence v3.0).
- PostgreSQL documentation: Logical Decoding Concepts โ Exported Snapshots.
- PostgreSQL documentation: Continuous Archiving and Point-in-Time Recovery.
Discover more from Insightful Data Lab
Subscribe to get the latest posts sent to your email.
