ContentsAI data migration
2AI data migration
5Lifecycle
7Playbooks
Guide · AI data migration
AI builds, it does not migrate
There are two ways to use an AI on a migration. This page shows both, shows how much more than SQL the AI does in the second way, and says what the challenge is and how the method meets it.
The data goes through the AI
- Each row can come back different.
- The cost grows with every row.
- No file shows how a row was changed.
The AI builds and runs the migration
The projectthe requirements, the documents, the status
The buildthe SQL files, the mappings, the checks
The proofthe runs, the counts, the problems, the totals
- The same data and the same mappings give the same result.
- The cost is for the build, not for the volume.
- A person can read each file, and run it again.
The same picture, as text
THE DATA GOES THROUGH THE AI THE AI BUILDS AND RUNS THE MIGRATION
old system ──► THE AI ──► new system THE AI works on every part of the workspace
row 1 the project the requirements, the documents, the status
row 2 the build the SQL files, the mappings, the checks
row 3 the proof the runs, the counts, the problems, the totals
…
row 50,000,000 old system ──► the SQL files, run by a database ──► new system
against each row can come back different for the same data and the same mappings give the same result
against the cost grows with every row for the cost is for the build, not for the volume
against no file shows how a row was changed for a person can read each file, and run it againThe first way sends the rows to the AI and asks for them back converted. It can be done, and it should not be. A language model can give a different answer to the same question, so no row is certain to come back the same on the next run, and the cost grows with every row. For gigabytes of data, that cost and that risk rule the first way out.
In the second way, the data does not go through the AI at all. A database runs the SQL files, and the rows flow through those. The AI does everything around the rows. It works on every part of the workspace, keeps the parts linked to each other and up to date, and runs much of the process, while people direct it and decide. This is what the guide means by AI data migration.
More than SQL scripts
One use of an AI on a migration is to have it write the SQL scripts. That works, and it leaves most of the migration where it was. A person still gathers the requirements, keeps the mappings, runs the load, reads the counts, updates the documents and reports the status, and holds all of it together by hand. This guide aims at more than that.
The AI writes the scripts
- Writes the SQL files.
- Gathers the requirements.
- Keeps the mappings.
- Runs the load, and reads the counts.
- Updates the documents.
- Reports the status.
- Holds all of it together by hand.
The AI saves some typing.
The AI works across the workspace
- Drafts the requirements from the meetings.
- Builds the SQL files and the checks.
- Prepares the value mapping for the business.
- Runs each step, and reads the counts and the problems.
- Keeps the documents and the status up to date.
- Follows a change to every file that it touches.
- Direct the work, decide, and check.
The AI carries the work of the migration, and people steer it.
The window on the page AI data migration shows the parts that the AI works on: the project, the build and the proof. The page What an AI can do lists the work.
The challenge
To have an AI work across a whole migration is harder than to have it write a script, and the difficulty is the same one that rules out sending rows through a model. An AI that is asked to do the same job twice does it a little differently each time. It also misses things, and it forgets what was settled earlier. On one script that matters little, because a person reads the script. Across a whole migration, with hundreds of files and months of decisions, the small differences add up to work that is very hard to follow.
The answer is also the same: structure, and context that is given every time.
- One patternEvery table is built the same way, so the hundredth table that the AI builds looks like the first.
- A workspace that remembersThe requirements, the decisions, the counts and the log of each run are kept in the folder. The AI reads them there, and does not depend on what it remembers.
- The same instructions each timeThe AI starts each piece of work from the same file of instructions: the folders, the rules, who decides what, and every command.
- Checks and countsWhat the AI misses is found by the run: a row that breaks a rule is flagged, and a count that does not close shows that a row is missing.
- People who decideA person approves each mapping and each send, so a slip of the AI is caught before it counts.
The details are many, and each one matters. That is why the structure is built once, in the method and in the tool, and not worked out again by each AI on each project.
The risks of AI, and how the method meets them
An AI brings risks of its own to a migration. Each one has an answer in the method, and each answer is a way of working that the rest of this guide already asks for.
- RepeatableKeep what the AI writes as a SQL file, and run the file.WhyAn AI that is asked the same question twice can give two answers. A migration is run many times, as trials, as rehearsals and at the cutover. A file that is run on the same data with the same mappings gives the same result. When a result does change, the cause is a line of the file, a mapping or the data, and it can be found.
- CostUse the AI to write the conversion, not to convert the rows.WhyThe use of an AI is charged by the amount of text that it reads and writes. The SQL for a table is the same length for ten rows and for ten million. So the cost of writing it does not grow with the volume.
- CheckableAsk for work that a person can open and read, and have a developer read it.WhyAn AI can write SQL that is wrong and looks right, as a person can. A conversation records what the AI said it did. A SQL file is what was done: a developer can read it, run it again, and compare the counts and the totals with the figures that the business gave.
A customer table has 50,000 rows. Sent through a language model, most rows come back as asked. A few can come back with a name respelled or a digit changed, and not the same few on the next run. So a row that was right in the rehearsal can be wrong at the cutover. Run through a SQL file, the 50,000 rows come back the same for as long as the file, the mappings and the data are the same. A difference therefore has a cause that can be found.
A table has two million rows, and the SQL that converts it is about forty lines. The AI writes those lines once, and corrects them a few times. The database then runs them on every row, at every rehearsal and at the cutover. The cost of the AI follows how hard the table is and how often it changes, not how many rows it has.
- AccountableLeave each decision with the person who owns it.WhyAn AI can be wrong and sound certain. What a value means belongs to the business, and what is in scope and when to go live belong to the project. If the AI settles those, no person has agreed to the result, and there is no one to ask about it later.
- Runs without AIMake sure that a person can do every step with no AI.WhySome organisations do not permit an AI to work on their data, and an AI service can be unavailable on the day of a run. A migration that only the AI can run stops in both cases.
In the old system, the status code C means "credit hold". The AI maps it to "Closed", which is a reasonable reading of the letter, and wrong. Because the mapping is a proposal, the person in the business who owns the code sees it and corrects it before it is recorded. The decision stays with the person who can answer for it.
More
- AI data migration
- Working with an AI
- Principles: the eight principles for AI.