Updating MediaWiki

The MediaWiki project provides an official wiki page which explains the procedure to update a wiki. Unfortunately, their instructions are complex, and the page contains a lot of information that is outdated or irrelevant for our users. To make it easier for our users to update, this documentation page aims to be more accessible and easier to understand. However, this page is not an authoritative source on the subject. If the instructions on this page are unclear at any point, you should always refer back to the official instructions.

In this guide, we assume you are familiar with the files on your ULYSSIS account. If you don't know how to access these files, please read Accessing your files first.

Downloading the latest version

To start updating MediaWiki, you will need to download the version you want to update to. If you arrived at this page after receiving an email from our Software Version Checker, follow the instructions in the next paragraph. Otherwise, you can skip the next paragraph.

The email you received might contain a line similar to:

- MediaWiki in <path>. Installed version: <version1>. Latest version: <version2>.

This line tells you where the MediaWiki installation is located, its current version, and the version you need to download.

If you don't have an email from our Software Version Checker, you can find your current MediaWiki version by going to the Special:Version page on your wiki (simply paste this in the search box) and looking for the "MediaWiki" version under "Installed software". For example, for this wiki, you can find the current version at Special:Version. At the time of writing, it looks like this:

Installed software.png

A table of all recent MediaWiki versions can be found on the the official table. Currently supported versions are indicated by a green or yellow color in the first column. To determine which version you want to download, follow these steps:

  • If the branch of your version (the first two numbers, like 1.xx) is currently supported (green or yellow), you should choose the latest version for this branch. For example, for version 1.35.3, the branch is 1.35.
  • If this branch is not supported anymore, you should choose the most recent LTS branch. This is indicated by (LTS) in the second column.
  • If the most recent LTS branch is older than your current branch, you should choose the newest supported branch (green).

Now, click on the link of the branch you want to download. This will redirect you to a page with information about this version. The first paragraph on this page contains a link to mediawiki-1.xx.yy.tar.gz. Download this file and save it somewhere on your PC.

Renaming the old installation

An important step in the update process is to rename the old installation directory. This way, you can simply copy your data from the old installation directory to the new installation directory during the update. Additionally, you can easily restore your old wiki if something goes wrong.

The easiest way to do this, is to rename your wiki location (the directory containing your LocalSettings.php configuration file) to a new directory. If you don't know how to access your files on your ULYSSIS account, refer to Accessing your files for easy instructions. For example, if LocalSettings.php is stored in www/wiki, you should rename this directory to www/wiki_old, or something similar.

Installing the new files

Now, you will need to upload the mediawiki-1.xx.yy.tar.gz file you downloaded in step 1 next to the old installation directory. For example, if your old installation directory is located in www/wiki_old, upload mediawiki-1.xx.yy.tar.gz to www/.

After uploading, you can extract the file on the server by using the Cyberduck "Expand Archive" feature. Simply right click the file and click "Expand Archive".

Cyberduck expand.png

This will create a directory named mediawiki-1.xx.yy. Rename this directory to the original name of your wiki directory on your ULYSSIS account. For example, if the original name was wiki, rename this directory from mediawiki-1.xx.yy to wiki. This can be done using Cyberduck by right clicking the directory and clicking "Rename".

Cyberduck rename.png

Finally, you need to copy the configuration files and other files or directories you modified from the old directory to the new directory. The easiest way to do this using Cyberduck is by creating a "New Browser". Right click the new directory, and click "New Browser".

Cyberduck new browser.png

Then, you can simply place both windows next to each other, and drag-and-drop files or directories to copy them from the old directory to the new directory. For example, copying LocalSettings.php:

Cyberduck drag and drop.png

Although the exact files you need to copy are different depending on your wiki, here are some suggestions from the official instructions:

  • LocalSettings.php, which contains your old configuration settings.
  • The directory containing the uploaded files to the wiki. Most likely, this is images/, unless you set the value $wgUploadDirectory in LocalSettings.php
  • In case you use a custom logo or favicon, this file also needs to be restored from the old installation. You can find the locations of these files by checking the $wgLogo and $wgFavicon values in LocalSettings.php.
  • Custom extensions from within the extensions/ directory. Be careful not to overwrite the default extensions that are bundled with the new MediaWiki version.
  • Custom skins from within the skins/ directory. Be careful not to overwrite the default skins that are bundled with the new MediaWiki version.
  • Any .htaccess file, if present. Make sure you can view hidden files; to enable this for Cyberduck, you can look at Accessing your files.

Updating extensions

If you use any extensions that are not bundled with MediaWiki by default, you should update them too. For example, you might have the ULYSSIS extensions MediaWikiShibboleth or CompressUploads installed. As the installation instructions for each extension are different for each extension, this page can't help you with this process. However, most extensions follow the same template as the MediaWiki upgrade itself:

  • Downloading the latest version: make sure to download the correct update for your new MediaWiki version.
  • Making a backup of the extension: you should already have a backup in the directory you created in step 2.
  • Extracting the files: similar to the MediaWiki zip files, you might have to copy the new extension files to a directory in the new extension/ directory.

Finalizing the update

The final step in the update process is to update the database structure of your wiki. The MediaWiki developers were kind enough to create a script, called update.php. This script can be executed using the Cyberduck "Send Command" feature.

Cyberduck send command.png

Enter the following command in the pop-up box:

php <wiki installation location>/maintenance/update.php

For example, if your wiki is located at www/wiki, the command should be as follows:

Cyberduck update.png

After pressing "Send", the command will be executed on the server. If everything went well, you should see a lot of output, ending with something like:

Cyberduck update output.png

Congratulations! You successfully updated MediaWiki. Still, there are two more important steps you must perform:

  • Test your new MediaWiki installation: make sure all basic functionality (viewing, editing pages, file upload) works and all your extensions function properly.
  • Delete the old installation: for example, if this is stored in www/wiki_old, you can remove it using the command line or through a GUI. A simple GUI explanation can be found on Accessing your files.

However, if you did encounter any errors while executing the script, you could try taking a look at the official instructions. If this does not resolve your problems, feel free to send us an email. We will try to assist you in completing the update.