It is important to keep on upgrading your MediaWiki installation to the latest stable release. New releases not only offer you the new features but also provide with security patches. MediaWiki upgrade is also important for better performance of the website. The newbie admins of MediaWiki, however, sometimes find updating MediaWiki a bit intriguing. For them, here is a list of simple steps to update MediaWiki.
Before you begin the process, you should put your wiki on read-only mode by making a setting in LocalSettings.php:
$wgReadOnly = 'Maintenance is underway. Website is on read-only mode';
Now, first make a backup of all the important files and mysql database. Take backup of the following items
- Database. This can be accomplished through phpMyAdmin. Using SSH access, backup of Mysql database can also be done by dumping
- extensions directory
- skins directory
- images directory: If you lots of images –it would consume a lot of time to download the entire directory via FTP. The better idea is to copy the images directory to a temporary folder on server via SSH access
- If you have changed the interface messages –then the corresponding file from languages/messages directory
Do not be lazy or complacent! It is easy to backup these things. It is better to be on the safer side in case of computers :-)
Now Download latest MediaWiki package from www.mediawiki.org/wiki/Download
Make sure your server environment supports the version of MediaWiki that you are planning to install. Give special attention to PHP and mysql versions. If your server does not support, you should first ask your host to upgrade server to required PHP and mysql versions.
Upload the new MediaWiki package on your server using an FTP client (like FileZilla).
Now open an SSH connection with your server using putty.
Unpack the package and copy the its content to your wiki directory. The new files should overwrite the existing files. For this you may use the following command:
$ tar xvzf PACKAGE_FILE_NAME -C PATH_TO_WIKI --strip-components=1
Now run the update.php file available in maintenance directory
$ php update.php
That's it! This unzipping and overwriting of files will update MediaWiki to the latest version.
Upload backed up message file and replace the new message file (only if you had made changes in the interface messages)
Check your website and see if it is running fine.
Check Special:Version page to see if it is showing the latest MediaWiki version.
Also try editing a page and upload a file to see if all is going on as it should.
If any extension is now working, download the latest version of the extension and install it.
In this process of MediaWiki upgrade, you might find the following Linux commands useful:
find total size of a directory: du -h | tail -n 1
copy entire directory: cp -r images/* ../temporary
Detailed procedure of how to upgrade MediaWiki is available on MediaWiki website: http://www.mediawiki.org/wiki/Manual:Upgrading
I hope these steps were of use for you and saved you some time! Please let me know if you have any questions.