How to Upgrade Your MediaWiki to 1.45
Upgrading to 1.45 follows the same disciplined process used for any major MediaWiki upgrade, but there are a few version‑specific details you should be aware of
How to Upgrade Your MediaWiki to 1.45
MediaWiki 1.45 is the next major release in the MediaWiki train. While the stable version is still 1.44, the 1.45 codebase is already available as an alpha on the MediaWiki 1.45 page. Upgrading to 1.45 follows the same disciplined process used for any major MediaWiki upgrade, but there are a few version‑specific details you should be aware of.
1. Prerequisites
- PHP 8.1 or newer (the minimum required for 1.45, see the Installation requirements page).
- One of the supported databases:
- MariaDB 10.3 +
- MySQL 5.7 +
- PostgreSQL 10 +
- SQLite 3.24 +
- Access to a shell (SSH) on the server – the command‑line updater is far more reliable than the web updater.
- All extensions and skins should be compatible with 1.45. Check the Extension Distributor or the individual extension pages for the required version.
2. Read the release notes
Before touching any files, open the RELEASE-NOTES-1.45 file that ships with the tarball (or view it on MediaWiki.org). It lists new configuration variables, removed features, and any database schema changes that will be applied by the updater. Knowing these ahead of time saves you from surprise errors later.
3. Clear pending jobs
MediaWiki defers certain maintenance tasks to the job queue. Run them now so they don’t fail after the schema changes:
php maintenance/runJobs.php4. Back up everything
Even though the upgrade scripts are robust, a backup is essential. Back up both the database and the file tree.
# MySQL example
mysqldump -u $DBUSER -p$DBPASS $DBNAME > /backups/wiki.sql
# Optional XML dump for content safety
php maintenance/dumpBackup.php --full > /backups/wiki.xml
# Files
tar czf /backups/wiki-files.tgz /var/www/mediawikiIf you use PostgreSQL or SQLite, replace the dump commands with the appropriate pg_dump or maintenance/SqliteMaintenance calls.
5. Obtain the 1.45 source
There are three common ways to get the new code:
- Tarball – download
mediawiki-master.tar.gzfrom the MediaWiki download page. - Git – clone the
REL1_45branch or simplygit checkout masterif you want the latest development snapshot. - Patch – for a small version bump you can apply the incremental patch, but for 1.45 a full checkout is recommended.
Extract the tarball (or copy the Git checkout) into a new, empty directory, e.g. /var/www/mediawiki-1.45. Do not unpack over the existing installation – that can leave stray old files that cause PHP errors.
6. Migrate custom files
Copy the following from your old installation (/var/www/mediawiki) into the new directory:
LocalSettings.php- The
images(oruploads) directory - Any custom skins in
skins/ - Any extensions you host locally (the
extensions/folder) - Optional:
.htaccessor other web‑server config files
After copying, verify ownership and permissions so the web server can read/write the images directory (e.g. chown -R www-data:www-data images on Debian‑based systems).
7. Adapt LocalSettings.php for 1.45
MediaWiki 1.45 introduces a few configuration changes. The most common adjustments are:
- Extension registration – ensure all extensions use the new
wfLoadExtension()syntax. Oldrequire_oncelines should be replaced. - Remove deprecated includes – delete any line that loads
DefaultSettings.php(removed in 1.38) and any references toRenameUser(merged into core in 1.40) orInterwiki(merged in 1.44).
Skin registration – if you are still using bundled skins (Vector, MonoBook, Modern, CologneBlue) add explicit loads:
wfLoadSkin( 'Vector' );
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Modern' );
wfLoadSkin( 'CologneBlue' );Check the "Adapt your LocalSettings.php" section of the upgrade manual for a complete checklist.
8. Run the update script
From the new directory, execute the updater. For MediaWiki ≥ 1.40 the unified script is maintenance/run.php:
php maintenance/run.php updateIf you see errors about missing database privileges, make sure $wgDBadminuser and $wgDBadminpassword are set in LocalSettings.php. For shared‑database installations add the --doshared flag.
9. Test the upgrade
Visit Special:Version on your wiki. It should now report "MediaWiki 1.45" and list the extensions with their new versions. Verify that core actions work:
- Viewing pages
- Editing a page (no read‑only warnings)
- Uploading a file
- Running a parser function (e.g.
{{#expr:1+1}})
If any of these fail, re‑check the error.log of your web server and the PHP error output for missing extensions or syntax errors introduced by outdated custom code.
10. Clean up old files
Once you are satisfied that the new installation works, delete or rename the old MediaWiki directory so that it is no longer reachable via the web. Leaving the old code exposed is a security risk.
11. Frequently asked questions
- Do I need to upgrade extensions first? No, but you must have a version of each extension that declares compatibility with MediaWiki ≥ 1.45. If an extension fails to load, comment it out, run the updater, then address the incompatibility.
- What if I’m on a very old MediaWiki (e.g. 1.30)? MediaWiki only supports direct upgrades from the two most recent LTS releases. In that case you need to upgrade in stages: 1.30 → 1.35 → 1.39 → 1.44 → 1.45.
Can I stay online during the upgrade? Yes. The typical approach is to set the wiki read‑only while the updater runs:
$wgReadOnly = 'Upgrading to MediaWiki 1.45 – please try again in a few minutes.';This can be added temporarily to the old LocalSettings.php before swapping directories.
12. Why upgrade to 1.45?
Beyond the new features listed on the MediaWiki 1.45 page, the release brings:
- Improved API performance and new Action API endpoints.
- Updated bundled extensions (e.g. Cite, ParserFunctions, VisualEditor) that fix long‑standing bugs.
- Modernised PHP codebase that removes deprecated functions, making future upgrades smoother.
- Security patches that address vulnerabilities discovered after the 1.44 release.
Staying on a supported version also ensures you receive security updates and benefit from the MediaWiki community’s ongoing improvements.
13. Next steps
After a successful upgrade, consider the following:
- Enable any new configuration options introduced in 1.45 (check the release notes).
- Run
php maintenance/rebuildUserGroups.phpif you have custom user‑group logic. - Schedule regular backups and monitor the
runJobs.phpqueue to keep the wiki healthy.
That’s it! With careful preparation, a full backup, and the steps above, moving your wiki to MediaWiki 1.45 should be a smooth, low‑risk operation.