MediaWiki/Upgrade/REL1 25 to REL1 26
Contents
Overview[edit | edit source]
Last updated in 2008, it was time to revisit this page and make some new notes. Even though the README, UPGRADE and online help are very detailed, I find it helpful to note my personal preferences, observations, and clarifications. Still, for the do-it-yourself types, the official docs are the best resource. If you need professional help with MediaWiki, then contact Greg Rundlett
The process obviously started with downloading the source from the web. However, since the wikipedia project uses the continuous integration method of development (meaning they always run their own latest code), I follow the same practice and run off either the latest release branch or master from the git repository. So, I simply did a composer update --no-dev && git fetch
to prepare for an upgrade.
Consult the release notes[edit | edit source]
Before doing anything, stop and consult the release notes supplied with the new version of the software. This detail bug fixes, new features and functionality, and any particular points that may need to be noted during the upgrade procedure. There was a lot here, although nothing that impacted the function of my installation.
Backup first[edit | edit source]
I copied my filesystem as a backup and testing ground.
For the database, I have a backup script that in addition to timed backups, will create a spot backup on demand: ~/bin/backup.db.sh mediawiki
Perform the file upgrade[edit | edit source]
The mechanism for loading extensions has changed, so the old 'requires' can be replaced by 'wfLoadExtension' function require_once\( *"\$IP/extensions/.*/([^/]*)" * \); wfLoadExtension( '\1' );
With the software downloaded (git fetch), and a check to see if you've modified anything (git status), you can simply switch the branch you're on git checkout -b REL1_26 origin/REL1_26
and then do the database upgrade.
You must preserve:
- The LocalSettings.php file
- DatabaseSettings file, where it exists
- The extensions directory
- The images directory
If using an alternative uploads directory, preserve this; and if using custom skins, preserve these too. The core code is now updated.
Perform the database upgrade[edit | edit source]
You will need an AdminSettings.php file set up in the correct format; see AdminSettings.sample in the wiki root for more information and examples.
From the command line, browse to the maintenance directory and run the update.php script to check and update the schema. This will insert missing tables, update existing tables, and move data around as needed. In most cases, this is successful and nothing further needs to be done.
cd wiki/maintenance/ ls php -q ./update.php
Check configuration settings[edit | edit source]
The names of configuration variables, and their default values and purposes, can change between release branches, e.g. $wgDisableUploads in 1.4 is replaced with $wgEnableUploads in later versions. When upgrading, consult the release notes to check for configuration changes which would alter the expected behaviour of MediaWiki.
Change the wiki pointer[edit | edit source]
In order to quickly upgrade, revert or take the site offline, you can simply use a symbolic link and point that to the correct target folder. However, note that this can present problems for your extensions when $IP
is not defined correctly
Test[edit | edit source]
It makes sense to test your wiki immediately following any kind of maintenance procedure, and especially after upgrading; check that page views and edits work normally and that special pages continue to function, etc. and correct errors and quirks which reveal themselves.