E
next.edzlms.com
Products
AIRolePlay (Gelato)
Services
Solutions
Resources
About
Watch DemoBook a Demo
next.edzlms.com

The AI learning OS for teams that need to perform — not just complete a quiz. Author with AI, assess with AI, practise with AI.

Product
  • LMS Platform
  • AI Course Builder
  • AI RolePlay
  • Study with AI
  • Onboarding AI
Services
  • LMS Development
  • Content Development
  • DevOps Support
Solutions
  • LMS Use Cases
  • RolePlay Use Cases
  • Corporate & Enterprise
  • Academics
Company
  • About Us
  • Security
  • Blog
  • Case Studies
  • Glossary
  • Contact
© 2026 EdzLMS · All rights reserved.
PrivacyTermsISO 9001 · ISO 27001
Home/Blog/LMS Strategy

How to Upgrade Moodle: The Complete Step-by-Step Guide (Including Moodle 5.0 Public Folder & Nginx)

A production-ready Moodle upgrade guide: pre-upgrade checks, backup, CLI steps, the Moodle 5.0 public folder restructure, nginx config, and verification.

ET
EdzLMS Team
·4 May 2026·4 min read
LMS STRATEGY
⚡ Quick answer

To upgrade Moodle safely: back up the database, moodledata, and code; check PHP and plugin compatibility; rehearse on staging; then run the CLI upgrade (maintenance mode, replace code, admin/cli/upgrade.php, purge caches). For Moodle 5.0, point your web root at the new public/ folder and update nginx.

By the numbers

CLI
safest upgrade path
3
backups: DB, data, code
public/
new 5.0 web root
Staging
rehearse first

Key takeaways

  • Always back up database, moodledata, and code before upgrading.
  • Rehearse the upgrade on staging before production.
  • Use the CLI: maintenance mode, replace code, run upgrade.php, purge caches.
  • Moodle 5.0 moves the web root to a public/ directory — update nginx.
  • Verify login, courses, plugins, cron, and logs after upgrading.
  • Major upgrades are where small mistakes cost hours — plan rollback.

Before you upgrade Moodle: a pre-flight checklist

A Moodle upgrade is low-risk if you prepare and high-risk if you don't. Before touching anything, work through this:

  • ✅ Full backup — database, the moodledata directory, and the codebase
  • ✅ Check requirements — PHP version, database version, and required extensions for your target release
  • ✅ Plugin compatibility — confirm every third-party plugin supports the new version
  • ✅ Staging first — rehearse the whole upgrade on a copy before production
  • ✅ Maintenance window — enable maintenance mode and tell users

Step-by-step: upgrading Moodle via CLI

The command line is the safest, most repeatable way to upgrade.

  • 1. Enable maintenance mode: php admin/cli/maintenance.php --enable
  • 2. Back up the database, moodledata, and current code.
  • 3. Replace the code — deploy the new Moodle release over a clean copy (don't merge over the old tree), then restore your config.php, plugins, and themes.
  • 4. Run the upgrade: php admin/cli/upgrade.php
  • 5. Purge caches: php admin/cli/purge_caches.php
  • 6. Disable maintenance mode and verify.

The Moodle 5.0 public folder restructure

Moodle 5.0 introduces a public/ directory change to the codebase layout: the web server document root points at the public folder rather than the Moodle root. This improves security by keeping non-public files out of the web root. When you upgrade to 5.x, plan to update your web-server document root accordingly and test that asset and login URLs resolve.

Nginx configuration notes

On nginx, point the root at the new public directory, ensure PHP-FPM handles .php requests, and confirm try_files and pretty-URL rules still work after the move. Reload nginx and test login, course pages, and file serving before reopening to users.

Post-upgrade verification

  • ✅ Site loads, login works, and a sample course renders
  • ✅ Plugins and theme display correctly (purge caches if not)
  • ✅ Cron is running and scheduled tasks complete
  • ✅ File uploads and downloads work
  • ✅ No errors in the server and PHP logs

Need a hand with your upgrade?

Major-version Moodle upgrades — especially the 5.0 directory change — are where small mistakes cost hours. EdzLMS plans, rehearses, and runs production Moodle upgrades with rollback ready.

Book a Free Demo →

Moodle upgrade, step by step

  1. 1
    Maintenance mode

    Enable it and notify users.

  2. 2
    Back up

    Database, moodledata, and codebase.

  3. 3
    Replace code

    Deploy the new release; restore config, plugins, themes.

  4. 4
    Run upgrade

    php admin/cli/upgrade.php, then purge caches.

  5. 5
    Verify

    Login, courses, plugins, cron, and logs.

⚠

Don't skip this

Always rehearse the full upgrade on staging with a fresh backup ready to roll back — major-version upgrades are where small mistakes cost hours.

Frequently asked questions

How do I upgrade Moodle safely?

Back up the database, moodledata, and code; check requirements and plugin compatibility; rehearse on staging; then run the CLI upgrade and verify before reopening to users.

What is the Moodle 5.0 public folder change?

Moodle 5.0 restructures the codebase so the web server document root points at a public/ directory, keeping non-public files out of the web root for better security.

Can I upgrade Moodle directly to the latest version?

Check the upgrade path — some versions require stepping through an intermediate release. Always confirm PHP and database requirements for your target version.

How do I upgrade Moodle from the command line?

Enable maintenance mode, back up, replace the code over a clean copy (restoring config.php, plugins, themes), run php admin/cli/upgrade.php, then purge caches.

What should I check after a Moodle upgrade?

Login, a sample course, plugin and theme display, cron and scheduled tasks, file upload/download, and server and PHP logs for errors.

Tags

MoodleUpgradeMoodle 5.0Nginx

Related articles

LMS Strategy3 min read

How to Measure LMS ROI and Training Impact in 2026

Measure LMS ROI with proven metrics, a simple formula, and a step-by-step method. A practical guide for L&D managers and HR leaders in 2026.

LMS Strategy3 min read

SCORM vs xAPI: Which Standard Does Your LMS Need?

SCORM vs xAPI in plain language — what each is good at and a simple decision guide for L&D and HR teams choosing the right eLearning standard.

LMS Strategy3 min read

Affordable LMS Solutions for Indian Businesses in 2026: Best Platforms Compared

Affordable doesn't have to mean basic. How LMS pricing works, what to watch for, and how Indian businesses get the best value without cutting corners in 2026.

See EdzLMS in action.

Book a 45-minute demo tailored to your industry.

Book a Free Demo →