mediawikimediawiki-extensionsmediawiki-templatesmediawiki-installation

MediaWiki update from 1.15 to latest version


Would it be possible to upgrade from MediaWiki from 1.15 to the latest stable version without losing data? I believe I will have a problem with database tables and extensions.

Thank you in advance


Solution

  • From personal experience I would recommend to take it easy and upgrade one major version at a time, especially when you do not have much experience with the process. This bite size approach will take longer but in return you will:

    This approach helped me when I was upgrading from 1.27.3 to 1.31.8 first time in years. I came across problems at least twice and could not find relevant information on how to deal with them. The most annoying was no feedback from the update.php script or blank page when trying the new installation.

    Below I include notes from my experience with updating MediaWiki in case that's of any help to anyone facing a big upgrade. These are just main points, so read the official Upgrading page too.

    Installation

    Don't extract a MediaWiki release archive into the existing wiki installation directory. Move the old instance to some backup directory and start afresh. Also make a back-up of the database.

    Create a copy of LocalSettings.php from the original installation and comment out all custom extensions and skins as they will no longer be present.

    Now as you bump the versions up:

    Once you reached the target version you can gradually copy over all the custom changes from the old wiki (extensions, modifications, images, skins etc.) remembering to enable them in LocalSettings.php.

    Keeping MediaWiki under version control makes it much easier to keep track of any customisations. Just make sure you keep the repository inaccessible to the world.

    Debugging

    In order to debug enable the following settings in LocalSettings.php:

    $wgShowExceptionDetails = true;
    $wgShowDBErrorBacktrace = true;
    $wgShowSQLErrors = true;
    

    Now go to the installation page https://.../mw-config/ (adjust the URL to match your set-up) and you should see some errors that might indicate what is wrong. For example, some skins or extensions from the older version may not supported any longer and you have to disable them in LocalSettings.php.

    Once the configuration has been updated try again until you get to the web installer.

    Once you managed to get to the web installer page stop there and try again with update.php script. It should work now. Close the web installer, there won't be any need to run it now.

    Once update.php has finished you should be able to access the wiki. Disable the debug settings in LocalSettings.php.