Tech:Upgrading MediaWiki

Normally, this can be followed but there are a few different or extra steps that need to be taken on Miraheze, since we are a wiki farm. This page will contain every step that is to be done, both for guide purposes but also in case users are interested in why it takes time or just how it is done.

New MediaWiki releases are generally done twice a year, and we try to upgrade as soon as the stable version is released.

Note: These steps do not all need to be done at the same time or even by the same person. Obvious steps such as "read the release notes" or anything that's not an action are not mentioned, but should nonetheless be done.

MW - Steps that need to be done by a MW Admin

O - Steps that can only be done/merged by Site Reliabilty Engineering


 * 1) MW  Fetch the new versions corresponding branch (REL[VERSION]), fix conflicts for files, and create a new branch for the Miraheze/MediaWiki repository.
 * 2) MW  Check all extensions and skins and see if there are any loading changes (wfLoad or require_once).
 * 3) MW  Check all extensions and skins and see if there are any SQL changes (such as new files or updated files). If there are new files that are not patches (i.e. ALTER, DELETE, DROP, etc.) they need to be added to $wgCreateWikiSQLFiles. If there are patches, they just need to be ran on every wiki using sql.php when the upgrade is performed - make a list of these.
 * 4) O  Change branch on test1wiki to the new version of MediaWiki.
 * 5) MW  Run update.php for test1wiki.
 * 6) MW  Make sure that all extensions and skins are compatible with the new version of MediaWiki. If there are any errors then they should be investigated, and if it is an obvious upstream issue, it should be filed and the extension in question should be disabled for the time being.
 * 7) MW  After it is made sure that the new version works fine on test1wiki, the actual upgrade can start. Set a time for the upgrade, and if it is in the next few hours make a sitenotice (and Twitter and Facebook notices are also a good idea)
 * 8) MW  Make all wikis read-only and have a sitenotice saying that they are being upgraded
 * 9) Note: These following steps are marked as "Site Reliabilty Engineering" as they need to be ran at the same time as operations-required steps
 * 10) O  Disable Puppet on mw* and depool mw1
 * 11) O  Switch default branch to new branch for mw*
 * 12) MW  Run update.php on all wikis
 * 13) O  Run all ALTER statements mentioned above.
 * 14) O  Switch depool to mw2 and run puppet
 * 15) O  Repool mw2
 * 16) <abbr class="newpage" title="Site Reliabilty Engineering">O  Switch depool to mw3 and run puppet
 * 17) <abbr class="newpage" title="Site Reliabilty Engineering">O  Repool mw3

The upgrade is done!