When you inherit a codebase, you have four options: keep it and maintain it, stabilise it first, upgrade its framework and runtime, or rewrite it. Most inherited apps should be kept, stabilised and upgraded in stages, not rewritten. A rewrite is the right call only when the stack can no longer be supported, or the product has outgrown its design, and an assessment shows that replacing it costs less than fixing it.
The rewrite instinct is strong. Unfamiliar code always looks worse than code you wrote yourself, and a fresh start feels cleaner. But the old code holds years of decisions about real customers and edge cases, and a rewrite has to rediscover all of them while the old app still needs looking after.
The four options at a glance
| Option | Choose it when | What it involves | Main risk |
|---|---|---|---|
| Keep and maintain | The app works, people use it, and changes are slow but safe | A monthly retainer for fixes, updates and features | Small problems pile up if nobody owns the app |
| Stabilise first | It breaks often, deploys are risky, there are no tests or monitoring | A focused month of backups, monitoring, safe deploys and urgent fixes | Skipping it and building features on shaky ground |
| Upgrade | The framework or runtime is near or past end of life, or security reviews fail on old versions | A staged upgrade project with tests added first | Doing it in one big jump instead of steps |
| Rewrite | The stack cannot be supported, or the product has outgrown its design | A phased rebuild that keeps the old app running until the new one is ready | Underestimating what the old code knows |
Signals that point to each option
Keep and maintain
- Customers use the app and its core workflows work.
- The code is unfamiliar, but changes, once understood, can be made safely.
- The stack is on supported versions, or close enough to upgrade routinely.
Keeping an app is not standing still. A good maintenance retainer adds tests, updates dependencies, documents the system and keeps shipping improvements, so the app gets healthier every month.
Stabilise first
- Production incidents happen often and take long to fix.
- Nobody wants to deploy, because deploys break things.
- There are no automated tests, no monitoring and no tested backups.
- Secrets sit in the code or in shared documents.
Stabilising usually takes a few weeks and pays for itself quickly: proven backups, monitoring and alerts, a staging copy, automated deploys with a one-step rollback, and fixes for the most urgent risks. After that, the app is safe to change.
Upgrade
- Django, Python, Node or another core part is near or past its end-of-life date.
- Security reviews, customer questionnaires or penetration tests flag old versions.
- Libraries you need no longer support your versions.
Upgrades go best in stages: add tests around the important flows, move one supported version at a time, and ship each step like a normal release. Paying for extended security patches can buy time, but it leaves you on an old version.
Rewrite
- The language or framework has no supported upgrade path, or the people who know it are no longer available.
- The product has changed so much that the data model no longer fits what the business does.
- Every change, even small, takes weeks because of how the system is built, and tests cannot be added around it.
- An assessment shows that fixing the existing system would cost more than replacing it.
When a rewrite is right, do it in phases: put the new system beside the old one, move one workflow at a time, and switch traffic gradually. A big-bang rewrite, with the old app frozen until the new one launches, is the version that most often goes wrong.
Questions to answer before you decide
- Can someone build and deploy the app from a clean copy of the code? If not, start there. You cannot judge a codebase you cannot run.
- What actually goes wrong? List the last ten incidents and slow changes. Problems with deploys, tests or monitoring point to stabilising, not rewriting.
- Is the stack supported? Check each framework, runtime and major library against its support dates.
- Does the data model still fit the business? If the core tables still describe what the business does, the app is usually worth keeping.
- What does the old code know? List the business rules, edge cases and integrations a rewrite would have to reproduce. The list is usually longer than expected.
- What would each option cost over two years? Include the cost of maintaining the old app while a rewrite is built.
How we approach it at MicroPyramid
When we take over an app, we do not decide in the first week. A fixed-scope Takeover Assessment gets the app building and deploying, maps the accounts, lists every dependency and its support date, reviews security and tests, and ends with one of these four recommendations in writing. Most of the time it is keep, stabilise and upgrade in stages, followed by a month-to-month maintenance retainer.
Read more about our software maintenance and takeovers, our Django and Python upgrade work, or what drives the cost of maintaining a custom app.
Frequently Asked Questions
Should I rewrite the app I inherited?
Usually not. Most inherited apps are worth keeping, stabilising and upgrading in stages. Rewrite only when the stack can no longer be supported, the product has outgrown its design, or an assessment shows replacing it costs less than fixing it.
Why do rewrites so often take longer than planned?
Because the old code holds years of business rules, edge cases and integration details that nobody wrote down. The rewrite has to rediscover them, and meanwhile the old app still needs fixes and support, so two systems are being paid for at once.
What does stabilising an app involve?
Proving the backups by restoring them, adding monitoring and alerts, setting up a staging copy and automated deploys with a one-step rollback, moving secrets out of the code, and fixing the most urgent risks. It usually takes a few weeks and makes every later change safer.
Can we upgrade Django or Python without a rewrite?
Yes. Upgrades go best in stages: add tests around the important flows, move through supported versions one at a time, and ship each step as a normal release. A rewrite is rarely needed just to get onto a supported version.
How do we know if the codebase is too far gone?
Signs include a language or framework with no supported upgrade path, a data model that no longer matches what the business does, and changes that take weeks even when small because tests cannot be added. Even then, confirm with an assessment before committing to a rewrite.
If we do rewrite, how do we reduce the risk?
Build the new system beside the old one and move one workflow at a time, switching traffic gradually, so customers are never left waiting for a big launch. Keep the old app maintained until the last workflow has moved.