Migrating a Moodle installation is one of the most underestimated technical projects in e-learning. Get it wrong and you're looking at weeks of downtime, lost completion records, and broken SCORM packages. Get it right—with the right preparation and a tested runbook—and you can execute a zero-downtime cutover that your users never notice.
This guide covers the complete migration process: from initial audit to post-migration validation, with specific guidance for organisations moving away from MoodleCloud or self-hosted installations to a managed hosting environment.
Why Organisations Migrate Moodle
Before diving into the how, it's worth understanding the why. Most Moodle migrations fall into one of four categories:
- Performance: Shared hosting can't handle peak concurrent users. Staff training deadlines create traffic spikes that crash the platform.
- MoodleCloud limitations: MoodleCloud's plugin restrictions, storage caps, and lack of server access force growing organisations to move to managed hosting.
- Cost: As organisations scale, MoodleCloud pricing escalates. A managed dedicated environment often costs less at 100+ users.
- Control: Compliance requirements (NHS Digital, CQC) require server-level access for audit logging, data residency, and security configuration.
Phase 1: Pre-Migration Audit
Never start a migration without a complete audit of your existing installation. You'll thank yourself during the cutover.
Content Inventory
- Number of courses, modules, and activities
- SCORM packages and their runtime versions (SCORM 1.2 vs 2004)
- Embedded video (hosted vs external YouTube/Vimeo)
- Third-party plugins list with version numbers
- Custom themes and their Moodle version compatibility
User and Enrolment Data
- Total user count and active users in the last 90 days
- Enrolment methods in use (manual, self-enrolment, cohort, external database)
- Course completion records (these are your most critical data)
- Certificate records and issued certificate PDFs
- Grade history
Integrations
- SSO/LDAP/Active Directory connections
- HR system integrations (user sync)
- Payment gateways (if selling courses)
- Zoom, Teams, or webinar integrations
- External database enrolment sources
Phase 2: Environment Preparation
Moodle Version Strategy
Migrations are the ideal time to upgrade Moodle versions. However, version jumping carries risk. Our recommended approach: migrate first at the same version, validate, then upgrade in a separate maintenance window. Two-step process, twice the confidence.
Check plugin compatibility before committing to a target version. Visit the Moodle plugins directory and verify each of your plugins supports your target version. Incompatible plugins are the #1 cause of failed migrations.
Server Sizing
Size your destination server based on peak concurrent users, not average. A useful rule of thumb: 1 vCPU and 2GB RAM per 50 concurrent users, with a minimum of 4 vCPU / 8GB RAM for any production Moodle instance. Add a separate database server for installations over 500 users.
Database Preparation
- Use PostgreSQL on the destination if migrating from MySQL — it handles Moodle's workload better at scale
- Set up read replicas for reporting queries to reduce load on the primary DB
- Configure connection pooling (PgBouncer) for high-concurrency environments
Phase 3: The Migration
Step 1: Full Backup
Take a complete Moodle backup using the built-in backup tool AND a filesystem-level backup. The Moodle backup captures course structures and content. The filesystem backup captures uploaded files, including SCORM packages stored in moodledata.
Step 2: Database Export
mysqldump -u moodle -p moodle_db > moodle_backup_YYYYMMDD.sql
# Or for PostgreSQL:
pg_dump -U moodle moodle_db > moodle_backup_YYYYMMDD.sql
Compress and encrypt before transfer. Never transfer unencrypted database files.
Step 3: File Transfer
Transfer moodledata (uploaded files, including SCORM packages) via rsync with checksum verification:
rsync -avz --checksum /var/moodledata/ user@newserver:/var/moodledata/
For large installations, use rsync for the initial bulk transfer, then run a second rsync pass during the maintenance window to catch changes made during the transfer.
Step 4: Maintenance Window Cutover
- Enable maintenance mode on the source Moodle
- Take final database snapshot
- Transfer delta (changes since initial sync)
- Restore on destination server
- Update config.php with new database credentials and wwwroot
- Run Moodle upgrade script (if version change)
- Update DNS TTL to 60 seconds (do this 24h before cutover)
- Point DNS to new server
- Validate (see Phase 4)
- Disable maintenance mode
Phase 4: Post-Migration Validation
Never end a migration without a structured validation pass. Check these specifically:
Critical Checks
- User login works (test with admin, teacher, and student accounts)
- Course completion records match pre-migration counts
- SCORM packages launch and resume correctly
- Certificate generation works (issue a test certificate)
- File uploads work (upload a test file in a course)
- Email notifications fire (trigger a test notification)
- All third-party plugins visible and functional
- SSO authentication works end-to-end
Performance Baseline
Run a basic load test immediately after migration to establish a performance baseline. Tools like Apache JMeter or k6 can simulate concurrent users. Document the baseline — it's your reference point for future performance investigations.
Common Migration Failures and How to Avoid Them
SCORM Packages Fail to Launch
Cause: File permissions on moodledata directory incorrect after transfer.
Fix: Set ownership to www-data:www-data and permissions to 755 recursively.
Completion Records Missing
Cause: Database charset mismatch (utf8 vs utf8mb4) causing truncated records.
Fix: Ensure both source and destination use utf8mb4 charset. Convert if necessary before migration.
Plugins Show as Incompatible
Cause: Plugin version in database doesn't match files on disk.
Fix: Run admin/cli/upgrade.php after file transfer to reconcile plugin versions.
MoodleCloud Specific Considerations
Migrating from MoodleCloud has additional constraints. MoodleCloud provides a backup export, but it doesn't include all database tables — only course content and user enrolments. You cannot export the raw database. This means:
- Completion history is included in the Moodle backup format
- Some plugin data may not transfer (check with Moodle support before migrating)
- Custom themes need to be recreated on the destination
- Third-party integrations need to be reconfigured from scratch
Budget 20% more time for MoodleCloud migrations than for self-hosted-to-managed migrations.
Conclusion
A successful Moodle migration is 80% preparation and 20% execution. The organisations that struggle are those that underestimate the audit phase and try to rush the cutover. Take the time to inventory your environment, test on a staging server, and walk through the validation checklist before you touch DNS.
With the right preparation, Moodle migrations are routine. Swift Learn has managed dozens of them, and we've never had a client lose completion records or face extended downtime. The secret is the runbook—and now you have one.