Skip to content
Back to Tutorials
Infrastructure Tutorial 1 min read

Moodle Migration Zero-Downtime Checklist (VPS + CloudPanel)

Roomi Kh

Published February 18, 2026 · Reviewed February 18, 2026

Moodle Migration Zero-Downtime Checklist (VPS + CloudPanel)

Use this when migrating a live Moodle LMS from shared hosting to VPS.

Related deep-dive: The Real-World Moodle Migration Playbook.

Prerequisites

  • Full backup access on source server
  • Target VPS (Ubuntu + PHP 8.2 + MariaDB)
  • Maintenance/cutover window

Step-by-Step

Step 1: Export source database

BASH
mysqldump -u USER -p DBNAME > moodle.sql

Step 2: Import into target database

BASH
mysql -u USER -p DBNAME < moodle.sql

Step 3: Sync moodledata and permissions

BASH
rsync -avz /old/moodledata/ /new/moodledata/
chown -R www-data:www-data /new/moodledata
chmod -R 755 /new/moodledata

Step 4: Update config.php

PHP
$CFG->wwwroot  = 'https://yourdomain.com';
$CFG->dataroot = '/home/user/moodledata';
$CFG->dbname   = 'dbname';
$CFG->dbuser   = 'dbuser';
$CFG->dbpass   = 'dbpass';

Step 5: Install required PHP extensions

BASH
apt install -y php8.2-xml php8.2-mysql php8.2-gd php8.2-curl \
  php8.2-zip php8.2-mbstring php8.2-intl php8.2-soap
systemctl restart php8.2-fpm

Step 6: Run Moodle CLI maintenance

BASH
php admin/cli/upgrade.php
php admin/cli/purge_caches.php
php admin/cli/cron.php

Step 7: Cutover sync and DNS switch

BASH
mysqldump -u USER -p live_db > final.sql
mysql -u USER -p new_db < final.sql
rsync -avz /old/moodledata/ /new/moodledata/

Switch DNS only after login, courses, upload, and cron are verified.

Fast Troubleshooting

  • HTTP 500: re-check config.php, PHP extensions, and permissions.
  • Missing courses/media: re-sync moodledata, then purge caches.
  • Theme issues: deploy theme code, rerun upgrade + purge.

For migration implementation support, see Custom Web Development or Contact ValeoFX.

Keep the Thread Going

Continue Reading

Keep moving from insight to action

Use the next article, service, or case study to keep building the thread instead of bouncing back to the index.