Rebuild platforms

Rewrite or repair? How we decide

Four questions that tell you whether to repair your software, rebuild it, or replace one part at a time, with a table of signs for each.

Why rewrites go wrong

Old code is ugly partly because it is full of decisions. The odd check in the invoice function exists because a customer once had two tax numbers. A rewrite has to rediscover each of those, usually when a customer complains.

The business keeps moving in the meantime. While the new version is being built, the old one still needs bug fixes and new features, so the team maintains two systems and the new one chases a target that keeps shifting. Many rewrites launch with fewer features than the product they replace.

We sell rebuilds, so we have a reason to recommend one. That is why we ask the same four questions every time.

The four questions

Is the data model sound?

Look at the database before the code. If the tables match how the business works, with one place for each fact and clear links between customers, orders and payments, most code problems on top can be repaired. If the same fact lives in several tables that disagree, or one giant table holds everything in loose JSON, each repair fights the base it stands on.

A bad data model is the strongest argument for a rebuild. Screens are cheap to redo. Data is not.

Can anyone change the code safely?

Ask a developer to make one small change, such as adding a field to a form, and watch what happens. If it takes an afternoon and breaks nothing, the code is workable. If it takes days, breaks an unrelated page and nobody can say why, the team has lost control of the code.

Check who that developer is. Code that only one person can change is a risk even when it works, and the fix for that is documentation and a second developer.

Are there tests?

Tests tell you whether a change broke something before your customers do. With tests in place, you can repair with confidence and refactor one piece at a time. With none, start by writing tests around the flows that carry money. That work is useful whichever way you go, because a rebuild needs the same tests to prove the new version behaves like the old one.

How much of the product still matches the business?

Some products were built for a business that has since changed. Say you started as a marketplace and now sell a subscription to one side of it. If most of the screens and rules describe the old model, repairing them preserves the wrong product. If the product still fits and the trouble is speed or bugs, a rewrite spends money to arrive where you already are.

Signs you can repair and signs you should rebuild

You can probably repair You should probably rebuild
The database tables match how the business works The same fact is stored in several places that disagree
A small change takes hours and stays contained A small change takes days and breaks other pages
Some tests exist, or the main flows are easy to test Nobody can test a flow without clicking through it by hand
At least two people understand the code The only person who understood it has left
The framework still gets security updates The framework or language version is no longer supported
Most features are still used as built Most of the product describes a business you no longer run

Count honestly. Two rows on the right do not justify a rebuild. Most of the right column does.

The middle path

Between repair and rewrite sits a third option that we choose more often than either. Replace one part at a time.

Pick the piece that hurts most, often checkout or the admin panel. Build its replacement beside the old system, send traffic for that one piece to the new code, and leave everything else alone. When it has run without trouble for a while, pick the next piece. The old system shrinks until you can switch it off.

This costs more in total than a clean rewrite would on paper. It wins anyway, because each step ships and earns its keep, and you can stop at any point with a working product. A rewrite that runs out of money halfway leaves you with nothing to launch.

The limit is the data model. If the tables are the problem, the new parts inherit it, and you need a full rebuild with a planned data move. That is the work our rebuild service covers.

Run the check before you ask anyone for a quote

You can answer most of this without us.

  1. Ask your developer to draw the main database tables on one page. If they cannot, that tells you something.
  2. Time one small change from request to live.
  3. Count the automated tests, and ask which flows they cover.
  4. List your features and mark the ones customers used last month.

Bring those four answers to any agency or freelancer and the conversation gets shorter and cheaper. An agency that recommends a rewrite without asking for them is guessing.

Bottom line: Repair when the data model is sound and changes stay contained. Rebuild when the data is wrong or the product describes a business you no longer run. In between, replace one part at a time.

If the four answers point in different directions, send them to us and we will tell you which way we would go, including when that means leaving the code alone.

RebuildsTechnical debtPlanning

Related service

Rebuild platforms. We rebuild old platforms that customers struggle with, and AI-built prototypes from Lovable, Cursor or Bolt that crack under real use. The new system grows beside the old one, with tested payments, checked data and a rollback ready, so you never switch off.

See the service→