Pre-Upgrade Checklist
Before touching any files, verify the following:- Read the release notes (
RELEASE-NOTES-1.46) for the new version, paying particular attention to:- Removed configuration variables
- Changed defaults
- Database schema changes
- Extension compatibility notes
- Confirm your server meets the PHP and database version requirements for the new release
- Check that all your extensions have compatible versions for the new MediaWiki release
- Notify users of the planned downtime window
Upgrade Steps
Put the wiki in read-only mode
Set
$wgReadOnly in LocalSettings.php to prevent edits during the upgrade. This avoids data inconsistency between the old and new schema.Back up the database
Take a full backup of the wiki database. Do not skip this step — the upgrade modifies the schema and some changes cannot be rolled back.Verify the backup is complete and can be restored.
Back up your files
Back up
LocalSettings.php, the extensions/ directory, the skins/ directory, and your upload directory (images/ by default).Download the new MediaWiki version
Download the new release from releases.wikimedia.org/mediawiki/ or check out the appropriate tag from Git.
Replace the MediaWiki files
Replace the existing MediaWiki files with the new ones. Preserve the following:
LocalSettings.phpextensions/directory (custom or third-party extensions)skins/directory (custom or third-party skins)- Your upload directory (default:
images/) - Any custom
$wgUploadDirectorypath
Update extensions and skins
Download compatible versions of your extensions and skins for the new MediaWiki version. Extension compatibility is documented on mediawiki.org.
Run the database upgrade script
This is the critical step that applies database schema changes and data migrations.The
--quick flag skips the 5-second countdown. The script will:- Check all extension dependencies
- Apply any missing database tables
- Alter existing tables to match the new schema
- Run data migration updates
- Report each applied change
If you need a DBA to apply schema changes separately, use
--schema to generate an SQL file:Review configuration changes
Check the release notes for removed or renamed configuration variables. MediaWiki 1.46 notable changes include:
$wgAPIRequestLogremoved (deprecated since 1.43)$wgBlockTargetMigrationStageremoved$wgSVGNativeRenderingnow defaults totrue$wgSVGConverterpresetssodipodiandimgservremoved
LocalSettings.php accordingly.Remove read-only mode and test
Remove (or comment out) Test the following:
$wgReadOnly from LocalSettings.php, then verify the upgrade:- Page views render correctly
- You can log in and log out
- Editing a page works
- Special pages load (Special:RecentChanges, Special:SpecialPages)
- File uploads work if your wiki uses them
- Key extensions are functional
Web-Based Upgrade
An alternative to the CLI upgrade is the web-based upgrade wizard. After replacing the files, browse tomw-config/index.php from your wiki’s domain. The wizard detects the existing configuration and guides you through the database update.
The web-based upgrade requires that
$wgAllowSchemaUpdates is true (the default). It is less suitable for large wikis or environments where schema changes need DBA review.Common Upgrade Issues
Composer dependencies missing
Extension compatibility errors
If an extension is incompatible, MediaWiki will refuse to load and display an error. Check the extension’s documentation for a compatible version, or temporarily disable the extension inLocalSettings.php:
$wgAllowSchemaUpdates is false
On wikis where schema updates are restricted,update.php will refuse to run without an override:
update.php fails partway through
Restore your database backup and investigate the error. Do not runupdate.php multiple times on a partially upgraded database without first restoring from backup.
White screen / fatal errors after upgrade
Enable PHP error logging and check your web server error log. Common causes:- Missing Composer dependencies (
composer install --no-dev) - Removed configuration variable still referenced in
LocalSettings.php - Incompatible extension still loaded
