Legacy LAMP Server Migration: Ubuntu 14.04 to 24.04 by Joseph JosephLegacy LAMP Server Migration: Ubuntu 14.04 to 24.04 by Joseph Joseph

Legacy LAMP Server Migration: Ubuntu 14.04 to 24.04

Joseph Joseph

Joseph Joseph

The problem

Many small businesses still run sites on Ubuntu 14.04 with PHP 5. Hosts are now shutting down vulnerable servers, and an in-place upgrade across five Ubuntu releases and three PHP major versions is slow and hard to undo.

The approach

Build a fresh server beside the old one, move the data, prove it matches, then switch DNS. The old server stays untouched until the new one is verified, so rollback is a single DNS change.
Inventory the old server (read-only): PHP modules, vhosts, databases, cron jobs, certificates, ports
Back up each database with exact per-table row counts, plus files, config and SHA-256 checksums
Provision Ubuntu 24.04 with PHP 8, MySQL 8, Certbot, a firewall and automatic security updates
Scan the code for features removed between PHP 5 and 8, then lint every file with PHP 8
Restore, checking every checksum first; old vhosts are staged for review, not enabled blindly
Verify every table's row count against the old server and test real URLs before DNS moves
Cut over DNS, with a documented rollback

The compatibility scanner

Reports each problem with file, line and fix: the mysql_* extension, ereg and split, each(), create_function, mcrypt, magic quotes, curly-brace string offsets, the /e regex modifier and more. It avoids lookalikes such as str_split and mysqli_*, and exits non-zero so it can gate CI.

Testing

GitHub Actions runs Bash and ShellCheck on every script, and tests the scanner against a PHP 5 app (must fail, every issue reported) and a PHP 8 app (must pass, no false positives) on PHP 8.3 and 8.4.
This is a personal portfolio project, not client work.
Like this project

Posted Nov 3, 2026

Personal project: a tested runbook and scripts to move an end-of-life Ubuntu 14.04 + PHP 5 server to Ubuntu 24.04 + PHP 8, with rollback built in.