Updating Mediawiki Installation: Difference between revisions
First commit |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
On bombur, go to <tt>/home/geos/WikiBackup</tt> and, per the README, run: | On bombur, go to <tt>/home/geos/WikiBackup</tt> 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 > geos5_wiki.2017Jul26.backup.sql | ||
mysqldump --opt --user=geos --password=<password> --host=mysql.geos5.org geos5_wiki --xml > geos5_wiki.2017Jul26.backup.xml | $ 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. | where the date is changed, of course. | ||
Then, gzip them for space saving. | 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 <tt>mediawiki-1.29.0/</tt> directory until we are ready to swap it for <tt>wiki/</tt>. | |||
== 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 <tt>extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php</tt> 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 <tt>wiki/</tt> | |||
=== 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 [https://www.mediawiki.org/wiki/Topic:Tv1swbwrwjpakgmk 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. |
Latest revision as of 05:59, 19 December 2017
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.