Skip to content

Blog

Data Migration Testing: How to Prove the Data Is Right

How to test a data migration: reconciliation counts and totals, field-level sampling, business-rule checks, rehearsals against production copies, and sign-off criteria.

3 min read · Dino Correia
data-migrationtestingchecklist

TL;DR

  • A migration is tested by proving the data is right, not by checking that the scripts finished.
  • Use layers: counts and totals, field-level samples, business-rule checks, and real users doing real tasks.
  • Rehearse against a full copy of production, and time it, before the real cutover.
  • Agree the sign-off criteria in advance, including what tolerance is acceptable and who signs.

You test a data migration by proving the migrated data is right: the same number of records, the same totals, the same answers to the questions the business asks of it. A migration script that finishes without errors has proved almost nothing. The checks below build confidence in layers, from cheap and broad to slow and specific.

The testing layers at a glance

LayerWhat it provesExample check
1. CountsNothing was lost or duplicatedRecords per table and per status match source
2. TotalsValues survived the moveSum of balances per customer matches to the penny
3. Field samplesTransformations are correct200 random records compared field by field
4. Business rulesThe data still makes senseNo invoice without a customer; no future-dated payments
5. Edge casesThe weird records survivedDeleted, merged, and multi-currency records checked by hand
6. User acceptancePeople can do their jobsReal users complete real tasks on migrated data
7. RehearsalIt works at full size, in timeFull production copy migrated within the cutover window

1. Counts

Count records in source and target for every entity, and break the counts down: by status, by year, by type. A total that matches can hide two categories that are each wrong in opposite directions. Records that are deliberately not migrated should be counted too, so the numbers add up.

2. Totals

Pick the numbers the business cares about, such as balances, amounts outstanding, and quantities, and compare them per customer or per account, not just overall. Overall totals can match while individual accounts are wrong.

3. Field-level samples

Take a random sample and compare every field, source against target, after transformation. Automate the comparison so the sample can be large, and include records created recently, records from years ago, and records that were edited many times.

4. Business-rule checks

Write queries for things that should never be true in the new system: orphaned records, impossible dates, negative quantities, duplicates on fields that should be unique. These catch mapping mistakes that counts and totals miss.

5. Edge cases

Every system has records nobody designed for: test accounts, manual fixes, merged customers, half-deleted data. Find them in the source before migrating (they are usually in the data migration checklist discovery step) and check each type by hand afterwards.

6. User acceptance

Ask the people who use the data to do their normal work on a migrated copy: find a customer, raise an invoice, run the month-end report. They notice things no query will, like a status label that now means something slightly different.

7. Rehearsal

Run the whole migration against a full copy of production at least once, ideally twice, and time it. A rehearsal answers questions no test environment can: does it fit the cutover window, what fails at full volume, and does the rollback actually work?

Agree sign-off before you start

Write down what “correct” means before anyone sees results: which checks must pass, what tolerance is acceptable (often zero for money), and who has the authority to sign off. Deciding that after the numbers come in turns every discrepancy into a negotiation.

After go-live

Keep the source system read-only and available for a defined period, and run the same reconciliation checks again after the first week of real use. Some problems only appear when new data starts mixing with migrated data.

Testing is one part of planning a migration; the rest is in the data migration checklist. If the migration carries real risk, a migration and integration assessment works out what will break before anything moves.

Where this leads

  1. If this is the situation you're in

    Migration & Integration Assessment →

    Understand data, dependencies and constraints before moving or connecting systems.

  2. How a problem like this was worked through

    Case study: Leaving a third-party platform →
  3. Or skip ahead

    Let's talk: tell me about the problem →

Related articles

Blog

Data Migration Checklist: What to Plan Before You Move

A practical data migration checklist: the questions to answer about source data, mapping, cutover, rollback, and validation before you move a single record.

· 6 min read
data-migrationsolution-architecturechecklist
Read →

Blog

Leaving a Third-Party System? Plan the Data Migration First

What happens when you move off a third-party system to own your data: the assumptions that break, and why the plan matters more than the migration itself.

· 3 min read
data-migrationsolution-architecture
Read →

Blog

Accounting Data Migration: Moving Financial Data Safely

How to migrate accounting and financial data between systems: what to move, opening balances vs full history, reconciliation, cutover timing, and the traps that break the books.

· 3 min read
data-migrationfintechchecklist
Read →

Working through something similar?

I help untangle problems like this one.