This article describes how to upgrade your MediaWiki installation. View the following guide at mediawiki.org for expanded upgrade instructions:
You need to download the updated version of MediaWiki before you begin. You can find download links for the currently supported MediaWiki versions on the following page:
Check the requirements
You can find an up-to-date list of MediaWiki's requirements within its manual:
Read the release notes
Release notes for MediaWiki are found in a RELEASE-NOTES-1.xx file in the main extracted folder. Additionally, you can find links to the release notes for all versions of MediaWiki on the following page:
Back up existing files and the database
Always make sure to first back up your database and website files before making any adjustments. This way, if something were to error you could quickly replace your files. View the following article for details:
Unpack the new files
Once you've backed up your existing site data, upload the updated MediaWiki archive that you downloaded to your web server via FTP. Then, log into your server via SSH, and decompress the file on the server. You should now have a new MediaWiki folder for the current installation.
Once the archive is extracted, copy over the following files and folders from the old installation directory to the new one:
- The images folder. In older versions, this was called uploads. If you've set a custom directory for images/uploads, copy that instead.
- Any extensions in the extensions directory that you haven't already updated/reinstalled.
- Your custom logo. Versions before 1.24 will store your logo in skins/common/images/, and newer versions use resources/assets/ or images/ Make sure to update LocalSettings.php with the updated path.
- Custom skins, found in the skins folder.
- Any custom modifications to the old files, which will need to be manually copied to the new versions of those files.
- Your .htaccess file, if customized.
If you have installed any extensions in the previous MediaWiki installation, you may need to upgrade them as well. Individual extension archives can be downloaded via the Download MediaWiki extension page. Alternatively, you can upload MwExtUpgrader to your site to batch-upgrade extensions. Once uploaded, run the following command to upgrade your extensions:
[server]$ php mwExtUpgrader.phar
Run the update script to check the database
It may be necessary to run the /maintenance/update.php script after upgrading. To do so, log into your site via SSH. Then run the following command:
[server]$ php ./maintenance/update.php
This runs an update script that should fix any current errors on your site. If that doesn't work, specify the full path to a version of PHP. For example:
[server]$ /usr/local/php74/bin/php ./maintenance/update.php
Test the update
Ensure that the following site features are working:
- Viewing pages
- Editing pages
- Uploading a file
- Visit /Special:Version in your browser to confirm the MediaWiki version and installed extensions.
Remove leftovers from old installations
Make sure that you delete or lock-down any old MediaWiki installation folders after the update is complete to ensure your site is secure.