Talk to an engineer

Upgrade PHP or migrate to Next.js? A decision framework

Most legacy PHP applications should be upgraded, not rewritten. Some should move to Next.js. Six questions that tell you which one you have.

SeaPHP engineering · November 12, 2026

When a PHP application ages out of support, two options come up in the same meeting. One person wants to upgrade it. Another wants to rebuild it in a modern JavaScript framework, usually Next.js. Both are often right about something, and the cost of choosing wrong is measured in years.

We do both kinds of work, so we have no reason to push either. This is the framework we use to decide, and we write the answer down before any work starts.

The default is to upgrade

A rewrite throws away everything the current application knows: the edge cases, the business rules nobody documented, the fixes for bugs that were reported once and never again. An upgrade keeps all of that. If the application is well-structured and the team that runs it is comfortable in PHP, upgrading is almost always cheaper and safer.

So the real question is not "upgrade or migrate". It is "is there a strong enough reason to migrate?" These six questions find out.

1. Where does the application's value live?

Draw a line between the front end (pages, templates, forms, what users see) and the back end (business logic, data, integrations).

  • If the value is in the back end, and the front end is a thin layer of templates, upgrade. The hard part is the logic, and it already works.
  • If the back end is simple, and the value is in the experience, such as a content-heavy public site, a portal people use daily, or a product that has to feel fast, migration starts to make sense.

2. Is the front end the bottleneck?

Next.js earns its place when the front end is what is holding the business back: slow pages that hurt search rankings or conversions, an interface that cannot be made accessible without a rebuild, or a design system the old templates cannot express. If none of those is true, the front end is not the problem and a migration will not fix what is.

3. What is the team moving toward?

A team that is already hiring for TypeScript and React will maintain a Next.js application more easily than a PHP one in five years. A team of experienced PHP engineers will not. Technology choices outlive the people who make them, so ask who will own the result.

4. Can the back end stand on its own?

The safest migrations keep the existing PHP as an API while Next.js takes over the pages. That only works if the business logic can be separated from the templates. If it is tangled into every view, plan for an upgrade first, a refactor second, and a migration only after that, if at all.

5. How long can the old system stay safe?

Migrations take longer than upgrades. A route-by-route migration of a large application can run for a year or more. During that time the PHP still serves traffic and still needs security fixes. If the runtime is already past end of life, the migration plan must include long-term support for it, or the project becomes a race against the next vulnerability.

6. What do search and compliance need?

Public sites carry years of search equity in their URLs. Regulated services carry accessibility obligations such as Section 508 and WCAG 2.2 AA. A migration must preserve the first and meet the second from the first page it ships. That is achievable, but it has to be in the plan and in the budget.

Reading the answers

  • Mostly back-end value, PHP team, tangled templates: upgrade PHP, cover the old version with LTS during the work, and stop there.
  • Front-end value, TypeScript team, separable back end: migrate to Next.js route by route, with PHP kept as the API and covered by LTS until the last route moves.
  • Mixed: upgrade now, separate the front end over time, and revisit the migration once the back end stands on its own. This is the most common answer, and it is a good one.

A note on WordPress

WordPress sites are a special case. Editors usually love the admin and dislike the front end. Keeping WordPress as a headless CMS and moving only the front end to Next.js often gives both groups what they want. We cover that pattern in detail in a separate article.

The written recommendation

Whichever way it goes, the decision should be written down with the cost of each option and the reasons for the choice. In a year, when someone asks why the team did not rewrite it, or why it did, the answer should not depend on who is still in the room.

Find out what your PHP estate needs

Tell us which versions you run and where. An engineer replies within one business day.