# Legacy system modernization: rehost, refactor, rebuild or replace

There are four practical ways to modernize a legacy system: rehost it on new infrastructure unchanged, refactor the existing code in place, rebuild it as a new system from the business rules, or replace it with a standard product. The right one depends on what is actually broken: the hardware, the code, the fit with the business, or all three. Whichever you choose, move one module at a time and reconcile the data at each step.

By Shai Goldenberg. Updated: 2026-11-15.

## What makes a system legacy

Age alone does not make a system legacy. A system becomes legacy when it still does its job and the company can no longer change it safely. Four signs show up together.

- **One person understands it.** The developer who wrote it, or the one employee who knows which button not to press.
- **The platform is out of support.** The operating system, database or runtime no longer receives security updates.
- **Nothing can connect to it.** No API, no export other than a printed report, and every new tool needs double entry.
- **It works only in the office.** A desktop application on specific machines, with no access from the field or from home.

The system often holds the company's real rules: how a price is calculated, when an order may ship, who approves what. That is why replacing it feels dangerous, and why leaving it alone becomes more dangerous each year.

## The four options

### Rehost

Move the system to new infrastructure and change nothing inside it. An application on a failing physical server moves to a virtual machine, or to a cloud instance. AWS calls this strategy rehost, also known as lift and shift, in its migration guidance.

**Fixes.** Hardware risk, and sometimes backup and remote access.

**Leaves.** Everything else. The code, the unsupported runtime, the missing API and the one person who understands it are all still there.

**Fits when.** The hardware is the urgent problem and you need time to plan the rest. Before a rehost, make sure a tested backup exists. Backing up very old systems has its own techniques, covered in [bare metal restore and legacy backup](https://goldenroz.com/blog/bare-metal-restore-and-legacy-backup/).

### Refactor

Keep the application and improve it from the inside: upgrade the runtime, add tests, separate the business rules from the screens, and add an API. The users see the same system.

**Fixes.** Support status, the ability to change the code and the ability to connect other systems.

**Leaves.** The original design and data model, with their limits.

**Fits when.** The source code exists, the technology is still supported in a newer version, and people who know that technology can be hired. It is a poor fit for a platform with no future, such as an Access database that many people share.

### Rebuild

Write a new system that does the same job. The business rules are extracted from the old code and data, confirmed with the people who use the system, and implemented on a current stack with a data model designed from those rules.

**Fixes.** All four signs, if done well.

**Leaves.** Nothing of the old system, which is also the risk. Rules nobody wrote down can be lost, which is why the extraction step comes first.

**Fits when.** The technology is a dead end, the process is specific to your company, and the system is central enough to justify the cost.

### Replace

Buy a standard product, an ERP module, a CRM or a field service system, and migrate the data into it. AWS's guidance calls this repurchase.

**Fixes.** All four signs, and the vendor carries the maintenance.

**Leaves.** A gap wherever your process differs from the product's. You either change the process or pay for customization, and you pay a subscription for as long as you use it.

**Fits when.** The process is common across your industry and a product covers it with configuration only.

## The options side by side

| | Rehost | Refactor | Rebuild | Replace |
|---|---|---|---|---|
| What changes | Infrastructure only | Code and structure | Everything, on a new stack | The system becomes a vendor's product |
| Business rules | Untouched | Preserved in the same code | Extracted and reimplemented | Mapped to the product's settings |
| Data migration | None, or a copy | Small | Full, with reconciliation | Full, into the vendor's model |
| Relative cost | Lowest | Medium | Highest up front | Subscription plus implementation |
| Main risk | Problems move with the system | The old design limits the result | Lost rules, long timeline | Process does not fit the product |
| You own the result | Yes | Yes | Yes | No, you rent it |

Two more options belong on any complete list: retire a system nobody uses, and retain one that is not worth touching yet. AWS's migration guidance lists seven strategies in total, known as the 7 Rs: retire, retain, rehost, relocate, repurchase, replatform and refactor. The four above are the ones that involve a real decision for a single business system.

Most real programs mix them. A common sequence is to rehost first to remove the hardware risk, then rebuild module by module while the old system keeps running.

## How to choose

Ask these questions in order. The first clear answer usually decides.

1. **Is anyone still using it?** List screens and reports with their last use. If the answer is no for the whole system, retire it.
2. **Does a standard product cover the process with configuration only?** If yes, replace. Buying is cheaper than building for a common process.
3. **Is the urgent problem only the hardware or the hosting?** If yes, rehost now and decide the rest without pressure.
4. **Is the technology still supported, and is the source code available?** If yes, and the design is sound, refactor.
5. **Otherwise, rebuild,** in phases.

Question 2 deserves real work. It means a written comparison of products against a custom build for that specific process, with costs and limits. That comparison is the first deliverable of our [digital transformation consulting](https://goldenroz.com/digital-transformation-consulting/) service, which maps one process, decides what to buy and what to build, and then builds the missing system. If a product fits, we say so.

## Migrating in phases, not in one weekend

A big-bang cutover, where the old system is switched off on Friday and the new one starts on Monday, concentrates all the risk in one moment. The alternative is to replace the system one module at a time. This is often called the strangler pattern.

1. **Inventory.** Read the code and the database. List every screen, report, scheduled job and integration, and mark which are still used.
2. **Extract the rules.** Write pricing rules, status changes and calculations in plain language. Confirm them with the people who do the work.
3. **Design the new data model** from the rules, not as a copy of the old tables.
4. **Pick the first module.** Choose one with clear boundaries and real users, not the hardest one.
5. **Run both systems side by side,** with data synced between them, until the module is proven.
6. **Repeat** for each module, then switch the old system off after the last one.
7. **Rehearse the final cutover** and write the rollback plan before the date.

Staff keep working throughout, because at every point one of the two systems is the source of truth for each module.

## The data is the hard part

Code can be rewritten. Twenty years of orders, customers and balances cannot be retyped. Most modernization failures are data failures: duplicates, free-text fields that hold structured information, codes whose meaning changed over the years, and totals that do not add up in the old system either.

Three practices keep this under control.

- **Scripted, repeatable imports.** The migration is a program that can be run again, not a one-time manual export.
- **Reconciliation after every run.** Record counts and financial totals are compared between old and new. A mismatch is investigated before cutover, not after.
- **Rules enforced in the database.** Constraints, foreign keys and access policies belong in the schema, so one application bug cannot corrupt the data. In PostgreSQL, access per role can be enforced with Row Level Security, explained in our [Supabase Row Level Security guide](https://goldenroz.com/blog/supabase-row-level-security/).

The schema, the migration pipeline and a tested restore are the subject of our [database consulting](https://goldenroz.com/database-consulting/) service, which focuses on PostgreSQL and Supabase. Shai Goldenberg, our CTO, runs a production PostgreSQL database of about 145 tables with Row Level Security on his own marketplace platform, which has gone through about 440 database migrations.

## What we take on, and what we do not

Goldenroz rebuilds old desktop, Access and early web applications as a TypeScript and React web application on PostgreSQL, module by module. The repository, the database and the hosting accounts are in your company's name.

We do not take on mainframe, COBOL or AS/400 estates. Those need a specialist firm with a large team. We also do not sell lift-and-shift hosting moves where the application itself is not changed. And we publish no client case studies for this service: the evidence we cite is Shai's own production work.

## What to do next

Write down the four signs from the top of this post and mark which apply to your system. Then answer the five questions in order. If the answer is rebuild, or you cannot tell between rebuild and replace, our [legacy modernization services](https://goldenroz.com/legacy-modernization-services/) start with a system inventory and business rule extraction, so the first phase tells you what you have before you commit to replacing it. Projects start at $25,000 with a fixed price per phase after a free scoping call, and larger programs run $100,000 and up.

## Questions buyers ask

### What is legacy system modernization?

It is the work of moving a business system that still runs, but can no longer be changed safely, onto a platform the company can maintain. That can mean new infrastructure, cleaned-up code, a new system built from the old rules, or a standard product that replaces it.

### What is the difference between rehost, refactor and rebuild?

Rehost moves the application to new servers or a cloud without changing it. Refactor changes the code and structure while keeping the same application. Rebuild writes a new application that does the same job, usually on a different stack and with a redesigned data model.

### Should we rebuild a legacy system or replace it with a product?

Replace it when a standard product covers the process with configuration only. Rebuild when the system holds rules that are specific to how your company works and no product covers them without heavy customization. A buy or build comparison for each process, with costs and limits, should come before any code.

### How do you modernize a system with no documentation?

The code and the database are the documentation. We read both, list every screen, report, scheduled job and integration, and write the business rules down in plain language. The people who use the system confirm those rules before any new code exists.

### How much does legacy modernization cost at Goldenroz?

Projects start at $25,000 with a fixed price per phase, quoted after a free scoping call. Larger programs with several modules and integrations run $100,000 and up. Mainframe, COBOL and AS/400 estates are outside what we take on.

---
Page: https://goldenroz.com/blog/legacy-system-modernization-guide/
Book a free one-hour call: https://calendly.com/daniarozin/daniel-rozin-consultation-1-hour-clone
