I use MediaWiki as a personal note-taking, documentation and code snippet storage system. This was started as an experiment, but a wiki proved to be a decent solution for the above tasks. This is a small checklist, mainly for my own reference, to follow when upgrading MediaWiki.
Dump the wiki database
This is done so to be sure that our wiki data is safe in case anything goes wrong (very unlikely):
mysqldump -u mymysqluser -p --opt --databases mywikidb > mywikidb.sql
Or if your database is too big, you can pipe it to
gzip before dumping to file:
mysqldump -u mymysqluser -p --opt --databases mywikidb | gzip -9 > mywikidb.sql.gz
How to restore the database
Just in case anything goes wrong with the upgrade procedure and you need to restore the backed up database, all you have to do is:
mysql -u mymysqluser -p mywikidb < mywikidb.sql
Backup the wiki files
Take a copy of the wiki files and directories:
cp -a wikidir wikidir.BAK
Delete old wiki files
Delete the old files and directories except:
extensions/directory (if there are any extensions installed)
images/directory (if there are uploaded images)
Upload the new wiki files
Move the new wiki files to the the wiki directory and set proper permissions:
chmod -R u=rwX,g=-,o=rX wikidir/
Note that you might need to further protect
LocalSettings.php and any other file that contains sensitive information, by restricting access to it with proper rules inside the
.htaccess file. For example:
<files ~ "^.+Settings\.php"> Order allow,deny Deny from all </files>
Upgrade the wiki database tables
Change to the
maintenance/ directory and run:
Also, it is recommended to refresh the links between the various articles inside the wiki. To do this run the
Delete the config/ directory
config/ directory is not needed so you might want to completely delete it or restrict access to it.
Apply any code modifications
Finally, apply any custom changes to the wiki code.
The MediaWiki Upgrade Procedure by George Notaras, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.