Moodle migration considerations and upgrade strategy

Context

Moodle v4.0.9 migration/upgrade from a shared hosting to a 4vCPU/8GB VPS; Ubuntu 25.04 LTS.

Constraints

  • Moodle 4.0.9 is outdated and officially unsupported. Upgrade is necessary.
  • Moodle 4.0.x Supports up to 8.0
  • Moodle 5.1(current) requires PHP≥8.2
  • Moodle 5.1 requires 4.2.3+ as min source to upgrade from
  • Have no access to current Moodle server/installation. I’ve been provided with necessary backups (db and system data). Need to wait until migration to analyze system state.
  • 5.1 introduces Moodle router. It needs to serve from /public directory.

Plan and strategy

  • Stack to provision new VPS; Nginx, PHP 8.0 + extensions, MariaDB 10.11, and Redis for caching/sessions.
  • Need to decide between:
    • Single-PHP: Install PHP 8.0 → restore 4.0.9 → upgrade to 4.2.3+ → switch to PHP8.2+ OR
    • Dual-PHP: Install PHP 8.0 and PHP 8.2+ side-by-side, point site to 8.0 and restore → upgrade to 4.2.3+ → switch/target PHP 8.2 → upgrade to 5.1