Lakeshift is a Databricks App that I built for one job: moving legacy SQL and ETL code to Databricks in a way that a team can measure, check and trust. It sizes the code first, makes a rule-based draft with Databricks Labs Lakebridge, lets two AI models convert and check the code, and asks a person to sign off every file.
In this article I explain how it works, step by step, with the Databricks features behind each step. At the end there is a "Do it yourself" section, so you can build the same flow with public tools.
Who this is for
- Migration leads who must give a size and an effort number before a migration starts.
- Migration engineers who convert files every day and want to compare outputs before they approve them.
- Platform teams who want the models, the API keys, the cost and the code to stay inside the Databricks workspace.
The problem
Many organisations still run a large amount of legacy SQL and ETL code: SSIS packages, Informatica PowerCenter mappings, DataStage jobs, and Oracle, Db2 and SQL Server procedures. A manual move to Databricks is slow, and at the start nobody knows how big the job is.
AI can convert code fast, but nobody wants unchecked AI code in production. And a team needs proof: which files are done, who approved them, and what changed. I wanted one place that answers two questions: how much work is this, and can we trust the converted code?
How it works

Every source system goes through the same five steps. The app shows one workbench page for each system, so you always see where each file stands.
- Upload. The engineer uploads files or a zip. A zip can hold one folder for each source system, for example ssis, oracle and db2. Each upload with new or changed files makes a new version. The legacy code goes into a Unity Catalog volume.
- Analyze. The Lakebridge Analyzer gives the complexity, the lines, the statements and the effort of each file. It can read 36 legacy platforms. Each version gets its own Excel report, which you can download with one click. The migration lead sees the size of the job before any conversion starts.
- Transpile. The Lakebridge Transpiler makes a rule-based draft, in the output that you choose from what Lakebridge supports. SQL systems go to Databricks SQL. ETL systems go to PySpark. This step uses only rules, so it has no AI cost. If the draft is good, the engineer can sign it off at once.
- Converge. When rules are not enough, two AI models work on the file. A builder model converts or fixes the code. A reviewer model checks it against the source. The reviewer lists every problem in one go, each with a severity: "must" or "should". The builder fixes each one, or disagrees and gives a reason. They go back and forth for up to 5 rounds, until no "must" finding is open. If they still do not agree, the file is marked "Needs you", and the engineer can run Converge again with a comment. Converge is optional: you can switch it off and use only the rule-based steps.
- Sign off. The engineer sees the source, the Transpiler draft and the AI version side by side, chooses the code and signs it off. Only signed-off code goes to the "converted" folder in the workspace. Every draft stays in a "history" folder.
A walk through one migration
Here is a short example from the demo. The test set has files from SSIS, Informatica PowerCenter, DataStage, Oracle, Db2 and SQL Server.
- The engineer uploads one zip with one folder for each system. Lakeshift creates one version for each system.
- Analyze runs. The overview now shows, for each system, how many files are low, medium or high complexity, and the effort in hours.
- Transpile runs for the systems that have a Lakebridge Transpiler dialect. For one file, the rule-based draft already looks good, so the engineer signs it off at once.
- Db2 has no Transpiler dialect, so Converge converts the Db2 procedure straight from the source. In the review, the reviewer made sure that the Db2 commit stays atomic: the insert and the delete must succeed or fail together. The builder fixed it, and the reviewer marked the finding as resolved.
- The overview shows progress, effort and the tokens that each model used, for every system.
What the migration lead gets
- An effort number before the work starts. A simple effort table maps each complexity level to hours (1, 4, 12 or 24 hours).
- One overview for all systems: files uploaded, analysed, transpiled, converged and signed off, plus the effort and the token use.
- Downloads for each system: a readiness workbook, the Analyzer report for each version, the review findings, and the signed-off code as a zip.
- Downloads for all systems: a readiness workbook, all review findings, all signed-off code, and the audit log as a CSV file.
Keeping the cost under control
- Rules first. Analyze and Transpile use no AI. The models only work where rules are not enough.
- Never do the same work twice. Each result is stored with the SHA-256 hash of the source file. A file that did not change is not analysed or converted again.
- Send only the changes. After the first review, the builder and the reviewer exchange only the open findings and the changes, not the full file. This keeps the token use low.
- See the cost. Every model call goes through Unity AI Gateway and shows in the AI Gateway usage system table.
Keeping the meaning of the data
For table and view definitions, Lakeshift also keeps the table and column comments. It carries the comments from the source first, with no model call. A model writes only the missing comments, and it gets only the names, the types and the known comments, not the code. Every comment has a label: "Carried from source", "AI suggested" or "Needs owner". A cryptic column name such as col7 gets no AI comment: it gets "Needs owner", and a person fills it in. The overview shows a "Documented %" for each system.
The Databricks features it uses
- Databricks Apps: one app does all the work, with no separate job.
- Declarative Automation Bundles: one script deploys everything.
- Unity Catalog: the catalog, the schema, the Delta tables for every result, the volumes for the source code and the reports, and the secrets for the API keys.
- Unity AI Gateway: model provider services and model services for the builder and the reviewer. You choose both models when you deploy.
- SQL warehouse, through the Statement Execution API.
- Databricks Labs Lakebridge: the Analyzer and the Transpiler, shipped inside the app.
Security and governance
- API keys are typed at a hidden prompt and kept as Unity Catalog secrets. Admins can use a key but cannot read it.
- The app masks secrets in the source code before any model call.
- Lakebridge and all libraries ship inside the app as pinned packages. The app needs no internet access, so it works in environments with no outbound access, such as many government environments.
- Only a person can put code in the "converted" folder, by sign-off. Every step is recorded in the audit log.
What it does not do
- It does not run the converted code or compare data. The review checks logic and syntax.
- It converts code. It does not move data.
- It does not set the conversion order of dependent objects.
- A very large file (more than 500,000 characters after the designer data is removed) gets "Needs you" with no model call.
See it in action

The overview page: progress, effort and token use for each source system.

The review rounds: the builder answers each reviewer finding, or disagrees with a reason.

The source and the AI version, side by side, before sign-off.
Do it yourself
You can build the core of this flow with public tools. You do not need my code.
- Size your legacy code. Install Databricks Labs Lakebridge and run its Analyzer on a folder of your SQL or ETL files. The report shows the complexity of each file. Docs: Lakebridge documentation
- Make a rule-based draft. Run the Lakebridge Transpiler on the same files. Keep this output as your baseline.
- Put your models behind Unity AI Gateway. Create a model provider service for each provider, so the keys stay in Databricks and every call is recorded. Docs: Create model provider services
- Use two roles, not one. One model converts, and a second model reviews. Give the reviewer three rules:
- In the first round, list all problems at once, each with a fix, a severity ("must" or "should") and a line number.
- In later rounds, look only at the open findings and the changes.
- Add a new finding only if a change gives a wrong result or does not run.
Stop after a fixed number of rounds. Send any file without agreement to a person. - Store a hash of each source file with each result. Then you never analyse or convert the same file twice.
- Make sign-off a person's job. Show the source, the rule-based draft and the AI version side by side. Only signed-off code goes to the workspace.
What I learned
- A reviewer model needs rules, or it never stops. Without the three rules in step 4 above, each round brought new small comments.
- Keep the rule-based draft. The Lakebridge draft gives the engineer a second view next to the AI version. Where the two differ, the engineer knows where to look first.
- Do not let a model guess the meaning of data. A column called col7 gets no AI comment. It gets the label "Needs owner", and a person fills it in.
- Cost is a design choice. Rules first, no repeat work, and only changes in later rounds. These three choices keep the AI cost small.
Lakeshift is one of my own projects. If you work on legacy code migration to Databricks, I am happy to compare notes. Ask me in the comments about any part.
Yougasundar Panneer Selvam, Data and AI architect, Singapore