What actually drives the cost of a PHP migration
Why line counts mislead, which six variables matter more, and how to have a useful budget conversation before anyone quotes a number.
By the phpreplace editors · Updated Oct 2026 · 11 min readAsk ten agencies what it costs to move a PHP application to a modern stack and you will hear ten numbers, most of them anchored to a single figure: how many lines of code there are. It is the easiest thing to measure and one of the least useful.
1. The trouble with line counts
Two applications of the same size can differ several-fold in effort. One is a thin layer of forms over a database. The other hides decades of pricing exceptions inside template files. Size tells you how much there is to read — not how much there is to understand, rebuild and prove.
Size tells you how much there is to read — not how much there is to prove.
2. Six variables that matter more
- 01Modules — how many distinct business areas, and how entangled they are.
- 02Integrations — every payment, ERP, mail or partner API is its own small project.
- 03Database complexity — schema quality, volume, and how much cleaning migration needs.
- 04Test coverage — without tests, parity tests must be written from observed behavior.
- 05Business-rule density — calculations, approvals, exceptions per screen.
- 06Strategy — incremental migration costs more in coordination, less in risk.
3. Costs people forget
Redirect maps for every public URL. Rehearsing the data migration more than once. Two rollback plans — one for traffic, one for data. Documentation and handover. None of these are glamorous, and all of them belong in a credible estimate.
4. Preparing the conversation
Before talking to anyone, write down the modules you know of, every external system the application talks to, the scheduled jobs that run overnight, and the people who understand each part. That list will do more for the accuracy of an estimate than any line count.
Get the modernization readiness checklist →