Upgrade service for Moodle™ sites, up to 5.3 LTS
Upgrading Moodle is rarely the hard part. Working out what will break, proving it on staging, and having a way back if the cutover goes wrong is the hard part. This page explains how I do it, in enough detail that you could do it yourself.
In short: A Moodle upgrade is a sequence of constrained hops governed by each release's minimum upgrade version, its PHP floor and its database minimums, and it should always be rehearsed on a staging clone with a tested rollback before any cutover.
How teams end up stranded on an old Moodle
Nobody decides to fall four versions behind. It happens in small steps. The upgrade is deferred because term is running. Then a third-party plugin has no release for the next version. Then the person who built the server leaves. Two years later the site is on a line that stopped receiving security fixes, the PHP on the box is too old for anything current, and the jump is now big enough that nobody wants to be the one who starts it.
That is the normal case, not a failure of discipline. Moodle ships a major release roughly every six months and the support windows are shorter than most people assume. Falling behind is the default outcome unless somebody owns the calendar.
How Moodle's release lifecycle works
Moodle publishes a major release about every six months, in April and October. Most are standard releases. Roughly every two years one is designated long-term support.
A standard release gets general bug fixes for about twelve months, then security-only fixes for roughly another six. An LTS gets a much longer security window, about three years from release. Once the security date passes, nothing further is published for that line.
Here is where things stand as of 19 October 2026.
| Release | Released | General support ends | Security support ends | LTS |
|---|---|---|---|---|
| 4.1 | 28 Nov 2022 | 11 Dec 2023 | 8 Dec 2025 | Yes |
| 4.3 | 9 Oct 2023 | 7 Oct 2024 | 21 Apr 2025 | No |
| 4.4 | 22 Apr 2024 | 21 Apr 2025 | 8 Dec 2025 | No |
| 4.5 | 7 Oct 2024 | 6 Oct 2025 | 4 Oct 2027 | Yes |
| 5.0 | 14 Apr 2025 | 20 Apr 2026 | 5 Oct 2026 | No |
| 5.1 | 6 Oct 2025 | 5 Oct 2026 | 19 Apr 2027 | No |
| 5.2 | 20 Apr 2026 | 19 Apr 2027 | 4 Oct 2027 | No |
| 5.3 | 5 Oct 2026 | 4 Oct 2027 | 1 Oct 2029 | Yes |
Three things follow. Moodle 5.0 left security support on 5 October 2026, so it joins 4.4 and everything older, including the old 4.1 LTS, outside support entirely. Moodle 5.1 is now on security fixes only. And 5.3 LTS has by far the longest runway, with security fixes to 1 October 2029, against 4 October 2027 for both 4.5 and 5.2. That matters when you choose a target.
Moodle 5.3 shipped on schedule on 5 October 2026. If you want the longest quiet period after the work, it is the release to plan around, rather than landing on 5.2 and repeating the exercise a year later. The caveat with any new line is plugin readiness: check that every third-party plugin you depend on has a 5.3 release before you commit to it. As the next section shows, 5.3 accepts the same starting versions as 5.2, so choosing it does not add a hop.
Finding your own version and its status
The site footer usually shows the release. The reliable method is from the command line, run from the Moodle installation root as the web server user:
sudo -u www-data php admin/cli/cfg.php --name=release
That prints something like 5.1.8 (Build: 20261005). The first two numbers are your release line, which is what the support dates above apply to. The third is your point release.
Point releases land on a published schedule, roughly every eight weeks. The set published on 5 October 2026, alongside Moodle 5.3, was 5.2.4, 5.1.8, 5.0.11 and 4.5.15. Moodle 5.0 left security support that same day, so no further fixes are due on that line. If your third number is well behind, you have missed security fixes even though your major line is supported. That is a far smaller job than a version upgrade, and it should be done first.
Upgrade path rules, and why you cannot always jump to latest
Moodle's upgrade code only carries database migration steps back a limited distance. Every release states the oldest version it can upgrade directly from. Go back further and the migration steps you need are simply not in the codebase.
| Target | Minimum version you can upgrade directly from |
|---|---|
| 4.1 LTS | 3.9 |
| 4.4 | 4.1.2 |
| 4.5 LTS | 4.1.2 |
| 5.0 | 4.2.3 |
| 5.1 | 4.2.3 |
| 5.2 | 4.4 |
| 5.3 LTS | 4.4 |
The governing policy is that a release must be upgraded from whichever is higher: the lowest Moodle version that supports the new release's minimum PHP version, or the minimum required by the previous LTS. Moodle's PHP policy page also says an LTS will always require the previous LTS or later, but the published notes for 5.3 LTS set its floor at 4.4, one line below 4.5, so plan against each release's own notes rather than deriving the floor. Moodle's own worked example is 5.0, which needs PHP 8.2, so its floor is 4.2.3, the first release that supported PHP 8.2. That is exactly the figure in the table above.
The policy has a consequence worth noticing before you pick a target. Moodle 5.2 and 5.3 both need PHP 8.3, and 4.4 was the first line to support PHP 8.3, so both accept 4.4 or later. It is easy to assume an LTS only accepts the previous LTS, which would be 4.5, but the published floor for 5.3 is 4.4. A site sitting on 4.4 can therefore move straight to either.
So a site on 3.11 cannot reach 5.2 or 5.3 in one move. A realistic chain is 3.11 to 4.1.x, then 4.1.x to 4.5.x, then 4.5.x to your final target. Landing on 4.5 as the waypoint is deliberate: it clears the floor for 5.2 and for 5.3, so the same intermediate hop serves either destination, and it is still inside security support if the project has to pause there. Each hop is a complete upgrade with its own backup and its own verification pass. Skipping verification between hops is how people end up with a database that migrated cleanly and a site that does not work.
What actually breaks
The PHP jump
The PHP floor moves faster than people expect. Moodle 4.4 and 4.5 need PHP 8.1.0 minimum and support up to 8.3.x. Moodle 5.0 and 5.1 need 8.2.0 and support 8.3.x and 8.4.x. Moodle 5.2 raises the floor again to 8.3.0, with 8.4.x supported, and 5.3 holds the same 8.3.0 floor. Only 64-bit PHP is supported, the sodium extension is required, and max_input_vars must be >= 5000.
The failure mode is not Moodle core. It is a third-party plugin using syntax or a function removed in the newer PHP, which throws a fatal error on a page nobody tests until a learner opens it.
The database engine
Minimums rise per release, and they do not all rise at once. Moodle 4.5 accepts PostgreSQL 13, MySQL 8.0, MariaDB 10.6.7 and SQL Server 2017. Moodle 5.1 sits in between, at PostgreSQL 15, MySQL 8.4, MariaDB 10.11.0 and SQL Server 2017. Moodle 5.2 requires PostgreSQL 16, MySQL 8.4, MariaDB 10.11.0 and SQL Server 2019. Moodle 5.3 raises two of those again, to PostgreSQL 17 and MariaDB 11.4.0, with MySQL 8.4 and SQL Server 2019 unchanged. A stock Ubuntu 24.04 server ships PostgreSQL 16 and MariaDB 10.11, so it meets 5.2 but needs a newer database before it can run 5.3. Oracle support was removed in 5.0, along with SQLite. If you are on Oracle, the upgrade is also a database migration.
Collation on MySQL and MariaDB
Older sites are frequently still on utf8 (really utf8mb3), which cannot store four-byte characters. Emoji and many Indic and CJK characters silently corrupt. Convert before the upgrade, not during it:
sudo -u www-data php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci
sudo -u www-data php admin/cli/mysql_compressed_rows.php --list
The conversion script only handles InnoDB or XtraDB tables, and for utf8mb4 it needs Barracuda row format with innodb_file_per_table enabled. It attempts to set those itself and stops with an explicit error if it cannot, which is where the conversion halts on a server that was not already configured that way. Despite the name it covers MariaDB as well, because the MariaDB driver reports a database family of mysql.
Set character-set-server = utf8mb4 and collation-server = utf8mb4_unicode_ci on the database server, and set the matching collation in config.php. Note that this is not a top-level setting: it lives inside the $CFG->dboptions array, as 'dbcollation' => 'utf8mb4_unicode_ci'. Moodle's own config-dist.php notes that the option should be removed entirely for any database other than MySQL or MariaDB. On a large table set the conversion takes real time, which is exactly why it belongs in its own window.
Plugins removed from core
Moodle 5.0 removed a lot: the Atto editor, the Chat and Survey activity modules, the CAS authentication plugin, the mlbackend_php plugin, all MNet plugins, Oracle and SQLite database support, and support for the legacy subplugins.php format.
This is the single most dangerous item on the page. If those plugins are not reinstalled from their standalone repositories before the upgrade completes, their database tables are dropped as part of the upgrade. Chat logs and survey responses go with them. Decide deliberately whether you are keeping or discarding that data, and take the backup either way.
Moodle 5.2 continues the trend, removing MimeTeX as a TeX filter option, the Activities block and the YUI TreeView in the Folder module. Moodle 5.3 removes the Classic theme from core, so a site still on Classic, or on a child theme built from it, needs a theme decision before the upgrade rather than after it.
Custom themes
Moodle 5.0 moved the Boost theme to Bootstrap 5. It also shipped a compatibility layer that keeps many Bootstrap 4 class names working, but that layer was deprecated from the start and is due to be removed in Moodle 6.0, and a child theme or custom template that leans on anything outside it renders wrongly rather than failing loudly, which makes it easy to miss until a user reports it. On a job like this, the theme is usually the line item to budget for properly: if it was built by an agency that has since moved on and the source is not under version control, you are looking at a rebuild rather than a patch, and that should be decided before the upgrade starts, not during it. What else Moodle 5.0 to 5.3 changed for themes is on the theme development page.
The 5.1 directory restructure
Moodle 5.1 moved web-accessible code into a public directory. Your web server document root must change from the Moodle folder to the public folder inside it:
# Apache
DocumentRoot /var/www/moodle/public
# Nginx
root /var/www/moodle/public;
Your config.php stays at the installation root, alongside public, not inside it. The public/config.php shipped with Moodle is only a loader that requires ../config.php. Existing $CFG->wwwroot and $CFG->dirroot values keep working. Third-party plugins from the old layout must be relocated by hand into public/mod/, public/theme/, public/blocks/, public/local/ and so on. Plugins left in the old positions will not be found, and local/ is the easiest directory to overlook, because so much contrib code lives there.
The CLI scripts themselves do not move. admin/cli/ stays at the installation root alongside public, so every command on this page is still run from the installation root on 5.1 and later.
The pre-upgrade audit
Before touching anything, I want a written answer to each of these:
- Current release and point release, from
admin/cli/cfg.php --name=release. - PHP version, extensions and
max_input_vars; database engine, version and collation. - Every installed plugin with its version, its maintainer, and whether a release exists for the target. Anything with no commits for two years is treated as abandoned until proven otherwise.
- Theme: stock, child theme, or bespoke. If bespoke, whether the source is under version control and whether anyone can still build it.
- Authentication and enrolment methods in use. LDAP, OAuth 2, SAML via a third-party plugin, or manual. Anything relying on a removed core plugin is a blocker, not a detail.
- Integrations: WordPress, an SSO bridge, a CRM, web service tokens, LTI tool registrations.
- Database size,
moodledatasize, and how long a full restore actually takes on that hardware. - The real quiet window. Not the theoretical one.
The output is a target version and a hop sequence, with the plugin decisions made in advance rather than discovered halfway through the cutover window.
Staging first, with a rollback that has been tested
Every upgrade is rehearsed on a clone before it touches production. The clone needs the same PHP and database versions as the intended production end state, otherwise it is not a rehearsal.
Take a full backup of all three components. They are only useful together:
sudo -u www-data php admin/cli/maintenance.php --enable
mysqldump --single-transaction --routines --triggers moodle | gzip > moodle-db.sql.gz
tar -czf moodledata.tar.gz /var/moodledata
tar -czf moodlecode.tar.gz /var/www/moodle
On PostgreSQL, use pg_dump -Fc instead. Then restore that backup onto the staging box and confirm the restored site actually loads. An untested backup is a hope, not a rollback. The rollback plan is the restore procedure you just ran, with the DNS or load balancer step written down.
Run each upgrade hop on staging non-interactively:
sudo -u www-data php admin/cli/upgrade.php --non-interactive
--non-interactive is the flag that matters: without it the script stops and waits for a confirmation, which is fine at a keyboard and useless inside a deployment script. If you are deliberately upgrading onto a build Moodle has not yet marked stable, add --allow-unstable as well, which the script requires in non-interactive mode for those versions.
Keep the full output. The warnings that scroll past during the first hop are usually the explanation for whatever misbehaves three hops later.
The cutover
The production run is the staging run repeated, with nothing improvised. Enable maintenance mode, take the fresh backup, swap the code, restore config.php to the correct location for the target version, adjust the document root if you are crossing 5.1, run the upgrade, then:
sudo -u www-data php admin/cli/purge_caches.php
sudo -u www-data php admin/cli/maintenance.php --disable
Caches must be purged explicitly. A stale cache after an upgrade produces symptoms that look exactly like a broken upgrade, which sends you diagnosing the wrong thing entirely.
Post-upgrade verification
Two commands do most of the work:
sudo -u www-data php admin/cli/check_database_schema.php
sudo -u www-data php admin/cli/checks.php -v
The first compares the live schema against what the installed plugins declare and exits non-zero on a mismatch, which catches a half-applied migration before your users do. The second runs Moodle's system checks; --filter=environment narrows the output to the server requirement checks, and --type selects a different set, such as the security or performance checks, instead of the default status set.
After that, the manual pass: log in as an administrator, a teacher and a learner. Open a course with each activity type you actually use. Submit an assignment. Open a quiz. Confirm the gradebook calculates. Trigger a cron run and confirm messages send. Check that scheduled tasks are not failing. Confirm any SSO or WordPress integration still round-trips a login.
Then check Site administration > Plugins > Plugins overview for anything flagged missing from disk, and clear it deliberately rather than leaving orphaned tables behind. The uninstall script runs in dry-run mode unless you tell it otherwise, so you get a preview first:
sudo -u www-data php admin/cli/uninstall_plugins.php --purge-missing
sudo -u www-data php admin/cli/uninstall_plugins.php --purge-missing --run
The first prints what would be removed. The second actually removes it. Read the first output properly before running the second, because this is not reversible without the backup.
If you are running IOMAD
IOMAD ships a version for each Moodle release line, but it is packaged separately and lands later. Its own stated target is three months after each Moodle release, and the lag has run longer than that: IOMAD 5.1 arrived in March 2026 against Moodle 5.1 in October 2025. As of October 2026 the newest IOMAD branch on GitHub is IOMAD_502_STABLE, tracking Moodle 5.2.4, and there is no IOMAD branch for Moodle 5.3 yet. So your target is an IOMAD branch rather than a Moodle tag, and the branch you want may not exist yet for the newest Moodle line. Plan the timing around IOMAD's calendar, not Moodle's.
Company structures, per-company themes and licence records all need checking after the upgrade, not just courses. The page on setup and development for IOMAD covers IOMAD work more broadly. If you are weighing platforms at the same time, I have written separately about multi-tenant Moodle with IOMAD and how it compares in IOMAD versus Moodle Workplace.
How I run an upgrade
I am Rohin Grover, and Hooknot Digital is a one-person studio. It is not a Moodle Partner and does not claim to be. You deal with the person doing the work, not an account manager.
The sequence is the one above: audit, target and hop plan agreed in writing, staging rehearsal, backup and rollback tested, cutover in a window you choose, verification pass, then a short period where I stay available for anything that surfaces once real users are back on the site.
Behind that is hands-on Moodle administration since 2016: installation, day-to-day administration, migration, course building, reporting, theme adjustments and troubleshooting. The work page sets out the client projects I can name, from a multi-tenant IOMAD platform for a training provider to a Spanish-language medical Moodle with a custom video watermarking plugin. The upgrade and migration work closest to this page includes an upgrade onto the 3.11 line and a move from MoodleCloud to a self-managed AWS server, and the services page covers the rest of what I do around Moodle.
What you need to provide
- SSH access to the server, or a hosting control panel with shell and database access.
- Database credentials, or a recent dump plus a copy of
moodledata. - A Moodle administrator account.
- Somewhere to put staging: a spare VPS, a subdomain, or approval for me to spin one up.
- DNS or load balancer access if the cutover involves a switch.
- A named person who can answer "is this how it looked before?" during verification.
- Any theme or plugin source that is not publicly available.
If some of that is missing, say so early. Working around absent access is usually possible, but it changes the plan and it is better known at the start.
Start with the version, not the quote
The first useful thing is knowing which version you are on, which target makes sense, and how many hops sit in between. That is a short conversation, and you are welcome to take the answer and do the upgrade yourself.
Run the cfg.php command above, note the release string, and get in touch with it, or book a 30-minute session and we can look at it together. Email works too: [email protected]. I reply personally, usually within a working day, which is a habit rather than a service level agreement. If you would rather start with something small and scoped, I also take Moodle work through Fiverr.
Common questions
- What is the latest version of Moodle right now?
- As of October 2026 the newest release is Moodle 5.3, released on 5 October 2026. It is a long-term support release, with general bug fixes to 4 October 2027 and security support to 1 October 2029. The point releases published the same day were 5.2.4, 5.1.8, 5.0.11 and 4.5.15. The previous LTS, Moodle 4.5, released October 2024, keeps security support to 4 October 2027.
- Can I upgrade from Moodle 3.11 straight to the latest version?
- No. Moodle only carries database migration steps back a limited distance, and each release states the oldest version it accepts. Moodle 5.2 and 5.3 can both be upgraded from 4.4 or later, and 5.0 and 5.1 only from 4.2.3 or later. From 3.11 you need intermediate hops, typically 3.11 to 4.1.x, then to 4.5.x, then to your final target. Landing on 4.5 is worth doing deliberately, since it clears the floor for both 5.2 and 5.3 and is still inside security support if the project has to pause there. Each hop needs its own backup and verification.
- What PHP version does Moodle 5.3 require?
- Moodle 5.3 requires PHP 8.3.0 as a minimum and supports PHP 8.3.x and 8.4.x, the same as Moodle 5.2. Only 64-bit PHP builds are supported. The sodium extension is required and max_input_vars must be at least 5000. Earlier lines differ: Moodle 5.0 and 5.1 need PHP 8.2.0 minimum, while Moodle 4.4 and 4.5 need PHP 8.1.0 minimum.
- Is Moodle 4.5 still supported in 2026?
- Yes, but only for security fixes. Moodle 4.5 became the previous LTS when Moodle 5.3 LTS shipped on 5 October 2026. Its general bug-fix support ended on 6 October 2025, and security support continues to 4 October 2027. Moodle 5.0 left security support on 5 October 2026, so a site on 5.0 is now in a worse position than one on 4.5. Moodle 4.4 and everything older, including the 4.1 LTS, left security support on 8 December 2025.
- What database versions does Moodle 5.3 need?
- Moodle 5.3 requires PostgreSQL 17, MySQL 8.4, MariaDB 11.4.0 or SQL Server 2019. That is a higher PostgreSQL and MariaDB floor than Moodle 5.2, which needs PostgreSQL 16, MySQL 8.4, MariaDB 10.11.0 or SQL Server 2019. Moodle 4.5's minimums are lower: PostgreSQL 13, MySQL 8.0, MariaDB 10.6.7 and SQL Server 2017. Oracle and SQLite support were both removed in Moodle 5.0, so an Oracle-backed site faces a database migration as well as an upgrade.
- What happens to Chat, Survey, Atto and CAS when I upgrade to Moodle 5.0?
- They were all removed from core in Moodle 5.0, along with the MNet plugins, mlbackend_php, Oracle and SQLite database support. Critically, if those plugins are not reinstalled from their standalone repositories before the upgrade completes, their database tables are dropped during the upgrade and the data goes with them. Decide in advance whether you are keeping or discarding chat logs and survey responses, and back up either way.
- Will upgrading Moodle break my custom theme?
- Very likely if you cross Moodle 5.0 or 5.1. Moodle 5.0 moved the Boost theme to Bootstrap 5. A compatibility layer keeps many Bootstrap 4 class names working for now, but it was deprecated from the day it shipped and is due to be removed in Moodle 6.0, and anything it does not cover renders incorrectly rather than failing visibly, which makes it easy to miss. Moodle 5.1 then moved web-accessible code into a public directory, so themes must be relocated to public/theme/ and the web server document root updated. Moodle 5.3 also removes the Classic theme from core, so a site on Classic, or on a child theme built from it, needs a theme decision before the upgrade.
- How do I check which Moodle version I am running?
- Run this from the Moodle installation root as your web server user: sudo -u www-data php admin/cli/cfg.php --name=release. It prints a string such as 5.1.8 (Build: 20261005). The first two numbers are your release line, which determines your support dates. The third is your point release, which should always be the newest available on that line, since point releases carry security fixes. On Moodle 5.1 and later the admin/cli directory is still at the installation root, alongside public, not inside it.
- Do I need to upgrade if my Moodle is working fine?
- If your release line is still within its security support window and you are on the newest point release, there is no urgency. If it is past the security date, you are running an application with publicly documented vulnerabilities and no fixes coming, which is a compliance problem as much as a technical one. Check your line against the support dates first, then plan around the current LTS, Moodle 5.3, rather than upgrading twice.
Talk it through with Rohin
Bring the messy version of the problem. A free 30-minute session is usually enough to tell you whether it is a small fix or a real project, and what it would take either way.