The urge to rewrite legacy systems from scratch is strong. The old code is messy, undocumented, and held together with string and hope. But the full rewrite is a trap - it takes twice as long as estimated, costs three times as much, and delivers a system that is missing half the edge cases the old one handled.
The wrapping pattern
Instead of rewriting, wrap. Put a modern API layer in front of the legacy system. The API speaks clean REST or GraphQL to the new world and translates to whatever the legacy system needs. This gives you immediate benefits: new frontends, mobile apps, and integrations can connect to the modern API while the legacy system continues doing what it does.
Strangler fig migration
Named after the tree that grows around and eventually replaces its host, the strangler fig pattern lets you replace legacy components one at a time. Each new feature goes into the modern system. Each legacy feature gets migrated when it needs changes anyway. Over months, the legacy system shrinks naturally.
Data migration is the hard part
Code can be rewritten. Business logic can be re-implemented. But data migration is where projects die. Legacy systems have decades of accumulated data with implicit relationships, undocumented formats, and silent corruption. Plan for data migration to take 40% of the total project timeline.
Quick wins build momentum
Start with a feature that is painful in the legacy system and easy to build in the modern one. A reporting dashboard that takes the legacy system 30 seconds to load but renders instantly with a modern frontend. That quick win builds organizational confidence for the longer migration ahead.