Guides
Legacy Migration Guide
Legacy migration moves older applications, runtimes, databases, and operating processes into a supported architecture while preserving business rules, data integrity, and external contracts.
Best used when: a business-critical system needs a new runtime, hosting model, architecture, or support path, but the old behavior still has to remain trustworthy during the move.
Autohand output: a dependency inventory, a slice-by-slice migration plan, generated migration tasks, equivalence checks, and a cutover runbook your team can inspect.
What is legacy migration?
Legacy migration is the planned movement of older applications, runtimes, databases, and operating processes into a supported architecture while keeping business rules, data integrity, and external contracts intact.
Autohand is useful when the migration has to be practical rather than theatrical: discover the real system, choose one migration slice, preserve contracts, validate old and new behavior, and cut over only when the evidence is good enough.
- COBOL, PL/I, or mainframe workloads moving to Java, .NET, Python, or cloud-native services.
- Monoliths moving toward service boundaries without breaking existing consumers.
- On-premises systems moving to cloud or private cloud with data and compliance constraints.
- Aging internal applications that need supported runtimes and clearer operating ownership.
Migration strategy comparison
The right migration path depends on what must stay stable: infrastructure, code behavior, data model, public contract, or all of them.
| Strategy | Best for | Tradeoff | Validation focus |
|---|---|---|---|
| Rehost | Moving infrastructure quickly with minimal code changes. | Old design problems usually remain. | Environment parity, batch jobs, integrations, and operations. |
| Replatform | Changing runtime or hosting while preserving most application behavior. | Compatibility shims can become long-term debt. | Runtime behavior, config, data access, and performance baselines. |
| Strangler replacement | Replacing one business capability at a time. | Routing, data ownership, and dual operation need discipline. | Contract tests, output comparison, traffic splits, and rollback criteria. |
| Rewrite | Cases where the legacy contract is intentionally being retired. | Hidden business rules are easiest to lose. | Requirements traceability, edge cases, and customer workflow coverage. |
Discovery and inventory
Begin with a comprehensive inventory of the running system. Treat batch schedules, copybooks, databases, queues, reports, manual operations, and downstream consumers as first-class migration inputs.
# Scan legacy codebase
autohand legacy scan --source /path/to/cobol
# Generate dependency map
autohand legacy dependencies --output deps.json
# Identify business logic hotspots
autohand legacy analyze --focus business-rules
The scan produces a catalog of programs, copybooks, data structures, and inter-system dependencies.
Plan the first migration slice
A migration slice should have a clear business capability, known consumers, testable inputs and outputs, and rollback criteria. Start smaller than the org chart suggests.
- Boundary: define the program, workflow, API, job, or data domain being replaced.
- Consumers: list every caller, batch dependency, report, and human operator affected.
- Equivalence: decide which outputs must match exactly and which can intentionally change.
- Rollback: define the operational path back to the legacy behavior before cutover.
# .autohand/migration-config.yaml
strategy: refactor
source:
language: cobol
compiler: enterprise-cobol
target:
language: java
framework: spring-boot
database: postgresql
options:
preserve_comments: true
generate_tests: true
documentation_level: detailed
Phased execution
Execute the migration in phases that produce reviewable artifacts. Each phase should update code, tests, docs, and the migration inventory together when those surfaces are affected.
# Phase 1: Convert data structures
autohand migrate --phase data-models
# Phase 2: Migrate business logic
autohand migrate --phase business-logic --batch 50
# Phase 3: Integration layer
autohand migrate --phase apis --preserve-contracts
# Validate each phase
autohand migrate validate --phase data-models
Parallel validation
Parallel validation runs legacy and modern behavior against the same important cases, then compares outputs, writes, errors, and timing where those values matter.
# Generate comparison tests
autohand migrate test --generate-equivalence
# Run parallel execution
autohand migrate test --parallel \
--legacy-endpoint localhost:8080 \
--modern-endpoint localhost:9090
# Compare outputs
autohand migrate diff --report equivalence.html
Use production-like fixtures when possible. If exact parity is impossible or undesirable, record the intentional difference and the owner who approved it.
Cutover planning
Plan the transition from legacy to modern systems before the replacement is complete:
- Define rollback procedures for each migration slice.
- Set up traffic splitting or job routing for gradual migration.
- Establish data synchronization, reconciliation, or read-only windows during transition.
- Document runbooks, ownership, alerts, and support paths for the new system.
Legacy migration FAQ
What is legacy migration?
Legacy migration moves older applications, runtimes, databases, and operating processes into a supported architecture while preserving business rules, data integrity, and external contracts.
How is legacy migration different from code modernization?
Legacy migration usually changes the runtime, architecture, hosting model, or system boundary. Code modernization can happen inside the existing system without moving the whole application.
How does Autohand verify a migrated system?
Autohand maps dependencies, generates migration tasks, runs old and new behavior in parallel where possible, compares outputs, and records evidence for reviewers and operators.