Updating Mediawiki Installation

Revision as of 05:59, 19 December 2017 by Mathomp4 (talk | contribs) (Update the Database)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Good Links

Most of what is presented here is synthesized from:

Backup the Database

On bombur, go to /home/geos/WikiBackup and, per the README, run:

$ mysqldump --opt --user=geos --password=<password> --host=mysql.geos5.org geos5_wiki > geos5_wiki.2017Jul26.backup.sql
$ mysqldump --opt --user=geos --password=<password> --host=mysql.geos5.org geos5_wiki --xml > geos5_wiki.2017Jul26.backup.xml

where the date is changed, of course.

Then, gzip them for space saving.

Get and Extract Mediawiki

A la the Mediawiki manual:

$ cd /home/geos/geos5.org
$ wget https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.0.tar.gz
$ tar -xvzf mediawiki-1.29.0.tar.gz 
$ rm mediawiki-1.29.0.tar.gz

Now we will work in the mediawiki-1.29.0/ directory until we are ready to swap it for wiki/.

Copy Over Needed Files

$ cd mediawiki-1.29.0

LocalSettings.php

$ cp ../wiki/LocalSettings.php .

images/

$ cp -rp ../wiki/images/* images/

skins/

For this, first do a diff, if the skins directories have the same folders, just accept the new ones. Mediawiki often fiddles with skin handling and you need to use 1.29 skins for 1.29. Luckily, GEOS-5 has little to no skin adaptation.

extensions/

Mainly, you want to copy over any directories that are in the old install but not in the new install. Anything in both, assume the newer is better.

SyntaxHighlight_GeSHi

This one is a bit tricky. There is currently a bug in extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php that we need to fix. It's essentially undoing a workaround they say fixes a bug...but the workaround causes a bug for us!

Once you are done with the upgrade, look at, say, Recipe: python program reads cubed-sphere data and make sure the highlighting is there!

Update MIME Types

Mediawiki's MIME tables need updating to allow .mm files as an XML file extension. To do this edit:

includes/libs/mime/mime.types

and change:

application/xml xml xsl xsd kml

to

application/xml xml xsl xsd kml mm

Update the Database

Rename the wiki directory

First, you move away the old wiki directory and make the new install wiki/

Set repo to read only

Edit LocalSettings.php and uncomment the last line to set in read-only mode:

# -------------------
# Added by M Thompson
# This puts the wiki into readonly mode
# -------------------
$wgReadOnly = 'Maintenance is underway. Website is on read-only mode';

Run update script

$ /usr/local/php56/bin/php maintenance/update.php

ISSUES

It turns out due to a bug in Mediawiki, you cannot run update.php if the site is in readonly mode. This is scary. It could mean inconsistent DB for any users on the wiki at that time.