| 1 |
This file provides an overview of the MediaWiki upgrade process. For help with |
| 2 |
specific problems, you should check: |
| 3 |
|
| 4 |
* the docs at https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents ; |
| 5 |
* the mediawiki-l mailing list archive at |
| 6 |
https://lists.wikimedia.org/hyperkitty/list/[email protected]/ ; |
| 7 |
and |
| 8 |
* the bug tracker at https://phabricator.wikimedia.org/ |
| 9 |
|
| 10 |
… for information and workarounds to common issues. |
| 11 |
|
| 12 |
== Overview == |
| 13 |
|
| 14 |
We provide comprehensive documentation on upgrading to the latest version of the |
| 15 |
software at https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading. |
| 16 |
|
| 17 |
Important: Upgrading from releases older than two LTS release is not supported anymore. |
| 18 |
If you want to upgrade from an old version, please upgrade to a more recent LTS version first, |
| 19 |
then to this version. |
| 20 |
|
| 21 |
Currently any upgrade from any version older than 1.35 will fail. |
| 22 |
|
| 23 |
=== Consult the release notes === |
| 24 |
|
| 25 |
Before doing anything, stop and consult the release notes supplied with the new |
| 26 |
version of the software. These detail bug fixes, new features and functionality, |
| 27 |
and any particular points that may need to be noted during the upgrade process. |
| 28 |
|
| 29 |
=== Backup first === |
| 30 |
|
| 31 |
It is imperative that, prior to attempting an upgrade of the database schema, |
| 32 |
you take a complete backup of your wiki database and files and verify it. While |
| 33 |
the upgrade scripts are somewhat robust, there is no guarantee that things will |
| 34 |
not fail, leaving the database in an inconsistent state. |
| 35 |
|
| 36 |
https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Backing_up_a_wiki is an |
| 37 |
overview of the backup process. You should also refer to the documentation for |
| 38 |
your database management system for information on backing up a database, and to |
| 39 |
your operating system documentation for information on making copies of files. |
| 40 |
|
| 41 |
=== Perform the file upgrade === |
| 42 |
|
| 43 |
Download the files for the new version of the software. These are available as a |
| 44 |
compressed "tar" archive from the Wikimedia Download Service |
| 45 |
(https://releases.wikimedia.org/mediawiki/). |
| 46 |
|
| 47 |
You can also obtain the new files directly from our Git source code repository. |
| 48 |
|
| 49 |
Replace the existing MediaWiki files with the new. You should preserve the |
| 50 |
LocalSettings.php file and the "extensions" and "images" directories. |
| 51 |
|
| 52 |
Depending upon your configuration, you may also need to preserve additional |
| 53 |
directories, including a custom upload directory ($wgUploadDirectory), |
| 54 |
deleted file archives, and any custom skins. |
| 55 |
|
| 56 |
=== Perform the database upgrade === |
| 57 |
|
| 58 |
As of 1.21, it is possible to separate schema changes (i.e. adding, dropping, or |
| 59 |
changing tables, fields, or indices) from all other database changes (e.g. |
| 60 |
populating fields). If you need this capability, see "From the command line" |
| 61 |
below. |
| 62 |
|
| 63 |
==== From the Web ==== |
| 64 |
|
| 65 |
If you browse to the Web-based installation script (usually at |
| 66 |
./mw-config/index.php) from your wiki installation you can follow the script and |
| 67 |
upgrade your database in place. |
| 68 |
|
| 69 |
==== From the command line ==== |
| 70 |
|
| 71 |
From the command line, browse to the "maintenance" directory and use |
| 72 |
`run.php update` to check and update the schema. This will insert missing |
| 73 |
tables, update existing tables, and move data around as needed. In most cases, |
| 74 |
this is successful and nothing further needs to be done. |
| 75 |
|
| 76 |
If you need to separate out the schema changes so they can be run by someone |
| 77 |
with more privileges, then you can use the --schema option to produce a text |
| 78 |
file with the necessary commands. You can use --schema, --noschema, |
| 79 |
$wgAllowSchemaUpdates as well as proper database permissions to enforce this |
| 80 |
separation. |
| 81 |
|
| 82 |
=== Check configuration settings === |
| 83 |
|
| 84 |
The names of configuration variables, and their default values and purposes, can |
| 85 |
change between release branches, e.g. $wgDisableUploads in 1.4 is replaced with |
| 86 |
$wgEnableUploads in later versions. When upgrading, consult the release notes to |
| 87 |
check for configuration changes which would alter the expected behavior of |
| 88 |
MediaWiki. |
| 89 |
|
| 90 |
=== Check installed extensions === |
| 91 |
|
| 92 |
Extensions usually need to be upgraded at the same time as the MediaWiki core. |
| 93 |
|
| 94 |
=== Test === |
| 95 |
|
| 96 |
It makes sense to test your wiki immediately following any kind of maintenance |
| 97 |
procedure, and especially after upgrading; check that page views and edits work |
| 98 |
normally, that special pages continue to function, etc., and correct any errors |
| 99 |
and quirks which reveal themselves. |
| 100 |
|
| 101 |
You should also test any extensions, and upgrade these if necessary. |