Quantcast
Channel: Blogercise» Mediawiki
Viewing all articles
Browse latest Browse all 9

How To Upgrade MediaWiki

$
0
0

There are always a couple of things I forget when upgrading MediaWiki, so here’s a quick post to help myself, and others, to remember what needs doing!

First of all, you’ll need to go and get the new version!

Photo

Upgrading Mediawiki

Each new release of Mediawiki includes upgrade instructions, look for “UPGRADE” in your download. Obviously this is the first place to look!  The following notes are no substitute for looking over the upgrade and release notes.  

You’ll also find upgrade instructions here.

When upgrading I upload the latest release into a new folder on my web server before renaming the existing folder and replacing it with the new.  That way I can easily swap back if something goes wrong and I need a quick recovery. 

Here are some tips:

  • Always take a backup!  Make a copy of all files and the wiki database!  You’ll need this if things go wrong, or if you need to locate any custom changes that you might have overwritten.
  • Ideally you should trial the upgrade on a copy of your wiki.  If you can’t afford for your wiki to be down then I would always suggest running the upgrade in parallel and testing thoroughly.

As of version 1.17 there is a handy new installer that will manage the upgrade for you via a web interface, you’ll find it here: yoursite.com/w/mw-config/index.php

Configuration

The key configurations for Mediawiki are all installed in LocalSettings.php.  You’ll find this in the root of your current installation.  You’ll need to keep this handy to ensure you successfully carry over the correct configuration to the new install.

When upgrading I simply take the LocalSetting.php file from my old install and place it into the root of the new install.  Note that some of the configurations may change, new ones may be introduced and old ones deprecated. 

Information about configuration changes can be found in the RELEASE NOTES file.  Or found online, for example.

Plugins

You will need to check for updates of any installed plugins as a new version of the plugin may be required to maintain compatability with your upgraded wiki.

Before you run your upgrade, make a record of all installed plugins and download any new versions.  For a smooth switch over you’ll need to upload these into your Extensions folder in advance.  

You can see what MediaWiki extensions you have currently installed by looking at the Special:Version page.

Custom Theme Updates

If you have made any changes to your site’s theme then you’ll need to make sure these are brought through too.  I’ve made a couple of edits to the Vector theme, for example I’ve got my Google Analytics code in there, I’ve added an Adsense banner, etc.

I have to replicate changes to the following two files:

  • Existing skin files are overwritten so I have to redo my edits to the main layout file for the skin that I use “skinsVector.php”.
  • If there are any other layout edits you’ve made then you’ll need to replicate these.  For example I have a custom edit to “includestemplatesUserlogin.php”. 

Ideally any updates such as this will be done through extensions but I’ve found MediaWiki not quite as mature as other content management systems when it comes to layout and themes.

Hint:If you ever need to compare two files and merge changes then I strongly suggest using a tool such as WinMerge for the job.

1.16->1.17 Upgrade

Here are some specific issues I came across with the upgrade to 1.17

  • UsabilityInitiative extension is now split into separate components.  The useful bits are the WikiEditor and Vector.
  • I hit this error: “Fatal error: Call to a member function setCacheTime() on a non-object in (path-to-wiki)/includes/parser/Parser.php”.  This is down to a compatability error with the vbulletin single sign on extension I use.  The quick fix was to remove a call to the disablecache function but I’ve not yet worked out what affect this will have.

Have you upgraded your wiki successfully?  Let us know how it went!


Viewing all articles
Browse latest Browse all 9

Trending Articles