Should You Rewrite a $20M Legacy Codebase? Insights from a Nightmare PHP Project

A struggling team inherits a 12‑year‑old, $20 million‑earning PHP monolith with no version control, chaotic front‑end, and massive Nginx routing, prompting a heated debate on whether to rewrite, refactor incrementally, or abandon the project altogether.

Programmer DD
Programmer DD
Programmer DD
Should You Rewrite a $20M Legacy Codebase? Insights from a Nightmare PHP Project

Advice 1: Don't rewrite, just quit

Many argue that a full rewrite is a bad idea, especially when the business is thriving; the code generates over $20 million annually, so from a commercial perspective it’s a cash‑cow that doesn’t need replacement. Executives may view the messy 2003‑style PHP as acceptable because the revenue outweighs technical concerns, making a rewrite a political as well as technical challenge.

Advice 2: Avoid a complete rewrite

Some suggest incremental improvements instead of a total rewrite. Options include forking the repository and delivering small features, introducing modern practices such as Git, code comments, branch testing, self‑hosted CI/CD, and adding tests before any database migrations. Updating the front‑end with a modern framework can boost performance and user experience, allowing the back‑end to be refactored gradually.

Fork the codebase and release incremental functionality to gain market advantage.

Adopt Git for version control, add comments, create feature branches, and set up CI/CD pipelines with automated testing.

Modernize the front‑end with a contemporary framework, then progressively refactor the back‑end as test coverage improves.

Advice 3: If you can't rewrite, consider leaving

When leadership is unwilling to invest in a rewrite or the team lacks full support, the recommended course may be to find a new job. Some contributors share personal experiences of successfully rewriting a similar $5 million PHP application to Django over two years, starting with small “20%‑time” projects, gradually redirecting traffic, and eventually gaining executive backing. However, without such backing, staying in a toxic legacy environment can stall career growth.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

team managementsoftware rewriteTechnical DebtLegacy Code
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.