How to Drive Large-Scale Technology Migrations Effectively

April 15, 2025

☕️ Support Us
Your support will help us to continue to provide quality content.👉 Buy Me a Coffee

A reader recently asked me: "My company's project was built with JavaScript instead of TypeScript from the start. Given the growing importance of TypeScript, and since I'm still learning it and need practical experience, how can I convince my company to let me use TypeScript?"

This is a common challenge. The key insight is showing your company that "migration costs aren't as high as expected." When teams realize the effort is manageable, they become more willing to invest in the transition.

But how do you make this happen?

Research Available Tools First

Before diving into any migration, spend time researching the tools that can help. If you're manually rewriting code line by line, you're doing it the hard way. The most effective migrations leverage automation wherever possible.

A great example comes from Stripe's engineering team. In their post Migrating millions of lines of code to TypeScript, they shared how they moved from Flow to TypeScript using a Codemod tool (link). Since many syntax transformations follow predictable patterns, they could automate large portions of the migration with scripts.

Even better, Airbnb open-sourced ts-migrate (link), which can convert entire JavaScript codebases to TypeScript. Yes, you'll end up with many any types initially, but that's okay. You can gradually improve the types over time while ensuring all new code is written in TypeScript.

This approach reduces initial migration costs to nearly zero (with the small trade-off of having any types scattered throughout your codebase). But the long-term benefits of writing new code in TypeScript make this worthwhile.

Using AI to Accelerate Migrations

Beyond traditional software tools, AI has become powerful for large-scale code migrations. Several major companies are already using this approach.

Google published How is Google using AI for internal code migrations? in 2025, describing how they use LLMs to help with internal code migrations. Amazon documented similar work in Evaluating Human-AI Partnership for LLM-based Code Migration, where they migrated millions of lines of Java code from Java 8 to Java 17 using LLMs. Airbnb also used LLMs to speed up large-scale test migrations (link).

LLMs excel at code migration because traditional tools have limitations. While traditional tools can handle fixed rules, code often has many variations that rigid rules can't capture. LLMs perform better in these variable scenarios.

Google's approach works like this: The LLM identifies code that needs migration, writes a new version, runs tests, and iterates until tests pass. Engineers then review the code. This process saved over 50% of the time needed for millions of lines of code migration.

Google's research highlights several key techniques:

  • Combining LLMs with AST tools ensures accuracy while reducing costs. AST tools handle predictable transformations with much less computational power than LLMs. For million-line migrations, this cost savings adds up significantly.

  • Providing LLM toolkits with test files, interface files, and dependency information gives the model sufficient context for better migrations.

  • Divide and conquer works well here too. You can't ask an AI to handle millions of lines at once, but breaking problems into smaller pieces and completing them one by one can still achieve large-scale results.

Next Steps

Effective large-scale technology migration involves many details beyond tools and AI, including upfront assessment, preparation, maintaining stability during migration, and crafting effective prompts when using AI assistance.

☕️ Support Us
Your support will help us to continue to provide quality content.👉 Buy Me a Coffee