Modernisation projects are estimated on the system being built and scheduled by the data being moved. Four kinds of problem hide in old records and only one of them is technical: fields whose meaning was never written down, records that break rules the new system enforces, duplicates nobody is authorised to merge, and history whose retention is a legal question. Each needs a decision from a person in the business, and those decisions queue behind people with other jobs. The single most useful thing you can do early is profile the real data, because it converts opinions about it into facts.
Every legacy replacement has a moment, usually a few months in, when the project stops being about the new system. Somebody opens the old database properly for the first time and discovers that nobody alive can explain what is in column 14.
That moment is the real start of the project, and it is almost always later than it should have been.
Why moving data is not the hard part
Copying rows from one store to another is a solved problem. What is not solved is agreeing what the rows mean, and that question has no technical answer.
A system that has run for fifteen years has been adapted by people who are no longer there, under pressure, for reasons that made sense at the time. A field holds two different things depending on the value of another field. A status code was retired but the records carrying it were not. A free-text note became load-bearing because the form never got the checkbox it needed. None of this is documented, because none of it was a decision anyone expected to outlive its author.
The new system, meanwhile, has a schema with constraints. That is the point of it. And every piece of old ambiguity now has to resolve into something definite before a single record can land.
Four kinds of problem, and who has to solve each
Meaning is the one with no workaround. If nobody can say what a field held, the options are archaeology through the old code, inference from the data's own distribution, or a decision to carry it across untouched and deal with it later. All three are legitimate; the one that must not happen is a developer quietly guessing.
Validity is mostly engineering, and it is the tractable one. The new system enforces rules the old one did not, so some records will not pass: a mandatory field that is empty in 3% of rows, a date that predates the company, a relationship pointing at something deleted. What engineering cannot decide is what to do with the exceptions — reject, default, or hold for manual repair — and that rule has to be agreed once, per case, by someone who owns the outcome.
Identity is where migrations stall quietly. The same customer exists three times because they were entered by three branches with three spellings. Merging them is not a technical difficulty; it is an authority question, and in regulated contexts merging two customer records may have consequences nobody on the project is entitled to accept.
History is a legal question first and a product question second. Retention obligations set a floor. Above that floor, the real question is what anyone will ever open, and the honest answer is usually “much less than we are about to migrate”. Carrying twenty years of detail into a new model is how a clean design acquires the old one's shape.
Profile the data before you map it
The highest-value early activity on any migration costs a few days: run a profile over the real data rather than the schema. Distinct values per column, null rates, format variants, lengths, outliers, and a count of how many records would fail each of the new system's rules.
This almost always changes the plan. A field believed to hold five codes holds forty, eleven of which appear once. A column documented as mandatory is empty in a tenth of rows. A date format changed in 2019 and both forms are present. None of this is visible in a schema or in a conversation, and all of it is cheap to find before anyone writes a mapping.
It also converts the conversation with the business from opinion to evidence. “We don't have duplicate customers” is harder to maintain next to a count.
Rehearse at full size, with the clock running
A migration tested on an extract tells you the logic works. It does not tell you the thing that matters on cutover night, which is how long it takes and what happens when a step fails two-thirds of the way through.
The last rehearsal should be full-volume, timed, on infrastructure resembling the real thing, with the rollback exercised rather than discussed. Most migration disasters are not wrong data; they are a run that was still going when the window closed, and a team discovering at four in the morning that the only way back was never tested.
Reconciliation belongs in the same place: counts and control totals agreed in advance, record-level comparison on a sample deliberately chosen to include the awkward cases, and sign-off from someone in the business rather than only from engineering. A migration that balances numerically can still be wrong in meaning, and the only people who will notice are the ones who use the data.
A sensible default
- Profile the real data in week one, before any mapping is written.
- Make a decision log, one line per ambiguous field, with the decision, the date and who made it. This document outlives the project.
- Cleanse in the source where the source is still live, so corrections are made once and by the people who understand them.
- Decide retention early, with legal, and move the rest to a read-only archive instead of into the new model.
- Design reconciliation before the first run, with business sign-off and a sample weighted towards the hard cases.
- Rehearse at full volume and time it, including a tested rollback.
Done this way, the migration stops being the thing that surprises everyone in the final month. It is the same principle as modernising without a rewrite: the risk is not in the new code, it is in everything the old system knew and never wrote down.
Questions we get asked
Why does data migration take longer than building the new system?
Because most of the work is not engineering. Moving rows between databases is straightforward; deciding what the rows mean is not. Old systems accumulate fields repurposed for a second use, codes whose definitions left with the person who set them, and records that break rules the new system will enforce. Each of those needs a decision from someone in the business, and those decisions queue behind people who have other jobs.
What is the first thing to do on a migration?
Profile the real data before writing any mapping. Count the distinct values in every column, the nulls, the formats, the outliers and the records that would fail the new system's validation. This takes days and routinely changes the plan, because it converts assumptions about the data into facts. A mapping written from a schema and a conversation describes the data somebody believes exists.
Should bad data be fixed before or during migration?
Before, wherever the source is still in use, because otherwise you fix it twice and the two copies diverge the moment someone edits the original. Cleansing in the source also keeps the correction with the people who understand the record. The exception is purely structural reshaping that has no meaning in the old system, which belongs in the migration itself and should be reproducible rather than done by hand.
How much history should be migrated?
Less than instinct suggests, and the answer is a legal and operational question rather than a technical one. Retention obligations set a floor, and beyond that the question is what anyone will actually open. A common and defensible pattern is to migrate recent live records in full and keep older history in a read-only archive that satisfies retention without imposing the old model on the new system.
How do you prove the migration was correct?
With reconciliation designed before the run: counts, control totals on the figures that matter, and record-level comparison on a sample chosen to include the awkward cases rather than at random. Both sides should be signed off by someone from the business, because a migration that balances technically can still be wrong in meaning. Anything that fails needs a documented, repeatable decision, not an ad-hoc fix.
How many rehearsals does a migration need?
More than one, and the last must be a full dress rehearsal on production-volume data with the clock running. Rehearsals answer questions a test run on a small extract cannot: how long it actually takes, whether it fits the available window, what happens when a step fails halfway, and whether the rollback works. A migration whose duration has never been measured at full scale is an unbounded risk on cutover night.
If a replacement is being scoped and nobody has opened the old data yet, that is the week to spend. It is where we start on modernisation work, because it is the part that sets the date.