Update MediWiki

How to update MediaWiki

Put wiki into readonly mode by editing the LocalSettings.php file and adding the line:

$wgReadOnly = 'Wiki is currently undergoing maintenance, as a result it is in read only mode for a while';

Backup the SQL database, e.g. mysqldump -h host -u wiki -p wiki > wiki.sql

Backup the entire wiki folder:

mkdir backups/20170218
cp -rp http/* backups/20170218/.

Download latest version of MediaWiki from www.mediawiki.org/wiki/Download e.g.

wget https://releases.wikimedia.org/mediawiki/1.28/mediawiki-1.28.2.tar.gz

Unpack the file over the existing installation:

tar zxvf mediawiki-1.28.2.tar.gz -C http/w --strip-components=1

Now run the update:

cd http/w/maintenance
php update.php

Don’t forget to take it out of readonly mode by removing or commenting out the $wgReadOnly line in LocalSettings.php