Article summary
- The new system has rules that the old system didn't.
- It's not just a matter of matching fields.
- The shape of the data has changed over time.
- People use software in a manner inconsistent with its labeling.
- Not all data anomalies are errors.
- Unusual doesn't mean wrong.
- The old system has rules nobody remembers.
- How do you know the migration is correct?
- AI makes the easy parts easier; the hard parts are still hard.
If you’re thinking about migrating from an aging legacy system to a shiny new one, you might be seeing all the latest AI advances as a godsend. And certainly, AI has gotten better at reverse-engineering code in all shapes and sizes. It can accelerate the more mechanical aspects of a migration.
But the real challenges of a legacy system migration have less to do with programming and more to do with understanding decades of accumulated data, undocumented business rules, and human behavior. AI can help us investigate these problems, but it can’t handle them automatically.
The new system has rules that the old system didn’t.
Whether you’re migrating between existing systems or designing a new system from scratch, the new one is bound to have rules that the old one didn’t. You might be looking at the messiness of the old data and decide that some validation is needed in the new system to keep things clean.
The new system may enforce relationships that the old system never required. Fields that used to be optional might now be mandatory. Values that were once free-form text might have to come from a predefined list. A record that was perfectly acceptable in the old system might violate several business rules in its replacement.
Some of these constraints are intentional improvements. The new system was designed to prevent the inconsistencies and ambiguities that accumulated in the old one. But that creates a problem when you’re migrating historical data. What do you do with records that don’t satisfy the new rules?
AI can help identify these conflicts and suggest solutions. But deciding which compromises are acceptable requires an understanding of the business, not just the database.
It’s not just a matter of matching fields.
At first glance, data migration can look like a mapping exercise. Say the old system has a CustomerId field and the new system has a CustomerId field. Map one to the other and move on, right?
Unfortunately, real migrations rarely work that way. The old system might represent a business concept with a single field, while the new system distributes that information across several related entities. Sometimes two fields with nearly identical names mean different things, or fields with completely different names represent the same concept. Even when the fields appear to line up perfectly, subtle differences in their meanings can matter enormously.
AI is good at proposing mappings based on names, data types, documentation, and usage patterns. But a plausible mapping isn’t necessarily a correct mapping.
The shape of the data has changed over time.
A legacy database isn’t necessarily a consistent collection of records that all follow the same rules. It’s more like an archaeological site. Over the years, the application evolved. New fields were introduced, existing fields were repurposed, and business processes changed. Sometimes the application was modified to accommodate new requirements without converting the records that were already there.
Consequently, records created in different decades may follow entirely different conventions, even though they live in the same table. In the best case, you’ll have documentation for the data in both formats. But more likely, only the newest data shape will be documented.
This means the migration can’t always apply a single transformation to every row. It may need to understand when a record was created, which version of the application created it, and which business rules were in effect at the time.
People use software in a manner inconsistent with its labeling.
Software developers design systems around assumptions about how the software will be used. But when an application doesn’t support something they need, users frequently find creative ways around its limitations. Sometimes these workarounds are isolated incidents. Other times, they become established business processes used by an entire department for years. From a technical perspective, the data is in the wrong place. From the user’s perspective, the system has been working exactly as they need it to.
This creates one of the more interesting challenges in a migration: preserving information that the original data model never anticipated. It’s tempting to treat these records as bad data and clean them up (some of it simply will be bad data entry). But doing so without understanding how the data was actually used may destroy important information.
Not all data anomalies are errors.
In addition to data entry habits, inconsistencies can result from software defects, manual corrections, historical changes in business processes, incomplete transactions, or data imported from other systems. The data may have been present for decades without causing noticeable problems. But a new system with stricter validation will force the migration team to confront them.
Which value is correct? Should the migration preserve the inconsistency, correct it, or flag it for review? AI can identify contradictory information at a scale that would be impractical to examine manually. It can help categorize anomalies and suggest likely explanations. But identifying an inconsistency isn’t the same as determining the truth. Sometimes there’s simply not enough information to know what actually happened.
Unusual doesn’t mean wrong.
One of the dangers of cleaning up legacy data is assuming that anything unusual must be wrong. An unexpected status code might represent a rarely used but perfectly legitimate business process. An apparently impossible date might have a special historical meaning. Two records that look like duplicates might represent genuinely different events.
These cases are particularly challenging because automated analysis tends to focus on patterns. AI can recognize the common structure of thousands of records and identify the handful that don’t fit. But those outliers may be precisely the records that require the most careful treatment.
A migration that automatically normalizes every unusual value may produce cleaner-looking data while quietly making it less accurate. The goal shouldn’t be to make all the data look consistent, but to preserve its meaning.
The old system has rules nobody remembers.
Legacy systems often contain decades of accumulated business logic. And it’s scattered across application code, database triggers, stored procedures, etc. Over time, the people who originally designed and implemented those rules move on. Documentation becomes outdated. The reasons behind certain behaviors are forgotten.
Eventually, the old system itself becomes the most authoritative surviving description of how the business operates. AI can be quite helpful in reconstructing these rules from the various pieces. But discovering a rule is only the beginning.
Why was it introduced? Does it still serve a useful purpose? Was it a workaround for a problem that no longer exists? Is the new system intentionally designed to behave differently? Those questions aren’t necessarily answered by the code. And faithfully reproducing every behavior of the old system may be just as undesirable as ignoring those behaviors entirely.
How do you know the migration is correct?
This may be the hardest problem of all. Software developers are used to writing tests that compare actual results against expected results. But what happens when nobody knows what the expected result should be?
You can verify that every source record was processed. You can count records, compare totals, check referential integrity, and confirm that transformations followed the rules you implemented. AI can help generate these tests and make comprehensive validation far more practical. But a migration can pass every technical validation and still be wrong.
If you misunderstood the meaning of a field, every record will be transformed consistently and incorrectly. If you overlooked an undocumented business convention, your validation code will simply reinforce the same incorrect assumption as your transformation code.
Having AI generate both the migration and its tests doesn’t solve this problem. Both may reflect the same misunderstanding. Meaningful validation requires independent evidence: business experts, representative examples, comparisons against real-world outcomes, and careful examination of unusual cases. Even then, some uncertainty may remain.
AI makes the easy parts easier; the hard parts are still hard.
As with many things these days, AI definitely can help with a legacy data migration. But as the mechanical work becomes faster, the proportion of effort devoted to understanding the data, resolving ambiguity, and making business decisions becomes more apparent. AI can make writing migration software easier without making the migration itself proportionally easier.
The greatest risk isn’t that AI will fail to generate working code. It’s that it will generate perfectly working code based on an incorrect understanding of the data. A transformation script that crashes is relatively easy to identify and fix. A transformation script that runs successfully while subtly changing the meaning of thousands of records is much more dangerous.
Successful migrations require more than developers who can write transformation scripts. They require people who can investigate the history of a system, recognize when data doesn’t mean what it appears to mean, understand the differences between old and new business processes, and work with stakeholders to resolve ambiguities. They require an appreciation for the fact that legacy systems aren’t just outdated technology. They’re repositories of accumulated business knowledge, historical decisions, and decades of human improvisation.
AI gives us powerful new tools for exploring that complexity. It makes us faster at asking questions, testing hypotheses, and implementing solutions. But it doesn’t eliminate the need to ask the right questions in the first place.