A rewrite is justified when a defined replacement has a better risk-and-cost case than improving the existing system. Frustration with old code is useful evidence that something needs investigation, but it is not yet that comparison.
Start by establishing what is running, which business outcomes it supports and what must remain available during a change. The existing system contains behaviour, exceptions and data assumptions that a new codebase will also need to handle.
Compare three options
| Option | When to investigate it | Costs that are easy to omit |
|---|---|---|
| Repair or refactor | The workflow and platform still fit, but specific defects block change | Regression tests, untangling dependencies and release risk |
| Replace a bounded part | One capability has a clear interface and an identifiable owner | Data mapping, coexistence and integration during migration |
| Replace the wider system | Fundamental constraints prevent required operation or a supported path forward | Migration, parallel maintenance, training, cutover and recovery |
Unsupported components or an unsuitable data model may strengthen the replacement case. They do not establish that every surrounding component must also change.
Recover the actual behaviour
Choose the most important workflow and list normal, denied and exceptional outcomes. Compare code, production configuration and representative records. Interview operators about the workarounds that are absent from tickets.
Before changing a legacy system, verify repository-to-production parity and the ability to build and release the known version. Otherwise the team may plan against a snapshot that does not correspond to the service customers use.
Run a small investigation
Take one troublesome change and estimate all three options. Identify what remains unknown and which short experiment could resolve it. For example, can one pricing rule be isolated behind a stable interface without changing order history?
Use the experiment to test a boundary, not to build an entire replacement before making the decision. Record assumptions, acceptance criteria and an explicit stopping point if the expected benefit does not materialise.
Plan coexistence and data responsibility
Gradual replacement, often described through the Strangler Fig approach, can keep an existing service useful while a capability moves. It also creates a period in which ownership must be especially clear.
For each data item define the authoritative writer, migration method, reconciliation and recovery path. Avoid uncontrolled dual writes. An application rollback may not undo a completed data migration, so assess compatibility and restoration separately.
Set cutover criteria before the deadline
For a fictional document workflow, a cutover gate might require matching migrated records, correct permissions, known handling of missing files, a demonstrated new deployment and an agreed recovery procedure. Compare outcomes, not just row counts or screenshots.
Keep support for the old path until the dependency and recovery decision is explicit. Retiring an interface, revoking supplier access and deleting data are different actions with different scopes and responsibilities.
Decide using the full cost
Include the roadmap work delayed by the replacement, operation of both versions and the time needed to discover undocumented behaviour. Do not promise a rewrite will prevent all future rewrites, or assume that incremental work is always cheaper. Some systems do need a larger replacement.
The decision record should say what will change, why the other options were rejected, who owns the transition and which evidence permits cutover. For execution details, see evolutionary architecture. If delivery or operating control has already been lost, H-Studio's software rescue begins with establishing a safe baseline.

