Kinsey Childress
Kinsey Childress

Reputation: 11

Bring old MediaWiki back online

Ive been recently tasked with updating an older media wiki (about 6 years ago) i know the version of ubuntu, mediawiki, php, and MySQL when the version was last running. I have access to the sql dump from the wiki archive. I have never worked with media wiki before and i really confused on how to start. I have basic technology knowledge but i dont understand how to even run the last working version of the wiki let alone update the site. If anyone is able to give me a quick overview of what i will need to do to just start that would be super helpful. I've viewed the page https://www.mediawiki.org/wiki/Manual:Upgrading on manual updating and it looks like there may be steps to complete before even looking into that page.

Upvotes: 1

Views: 209

Answers (1)

Alexander Mashin
Alexander Mashin

Reputation: 4602

In addition to restoring the database from its dump, you also need to recover the images directory with uploaded images and preferably, LocalSettings.php file with the settings from the old wiki—this file from a mature wiki is a valuable asset itself.

I assume that you have restored the database from your dump files, have git, composer, PHP 7 (with intl, mbstring, pcre, session, mysqli, openssl, json and fileinfo) and a frontend web server (nginx or Apache) installed and configured to run PHP scripts from w, serve images, etc. (this is itself a non-trivial task; consult the web). Switch error messages on in php.ini. Be prepared to read the web server error log.

  1. install MediaWiki: git clone https://gerrit.wikimedia.org/r/mediawiki/core.git w, cd w,
  2. switch to the required MediaWiki version. Suppose, it's 1.27: git checkout REL1_27,
  3. initialise the dependencies: git submodule update --recursive --init, composer update --prefer-source,
  4. drop the old LocalSettings.php (with necessary corrections) into w. If it is lost, run the configuration script (https://www.mediawiki.org/wiki/Manual:Config_script) or, better, make LocalSettings.php manually, setting the global variables needed to connect to the database and to the images folder,
  5. if you use the recovered LocalSettings.php, cd into w/extensions and install the missing extensions with git clone, doing git checkout REL1_27 and composer update --prefer-source for each,
  6. for each extension, bundled or not, read its page at https://mediawiki.org/wiki/Extension..., install missing dependencies and configure it in LocalSettings.php,
  7. try to connect to your wiki from your browser. Most probably, you will see some error message. Read and understand it: usually it will be about some missing dependency or misconfiguration. Correct those errors until your wiki is functional,
  8. open pages from different namespaces, including the main one, MediaWiki:, File:, Module:, etc. You may want to create one or more test pages in Project: namespace to test tags, parser functions, crucial templates, etc. Test editing and main special pages, upload a file. You will encounter further misconfigurations, which you will have to correct,
  9. only when you are sure that your wiki is up and running, do the upgrade:
    • backup the database and LocalSettings.php
    • read the release notes for the next version of MediaWiki,
    • do the necessary modifications to LocalSettings.php,
    • git checkout REL1_28, git submodule update --init --recursive, composer update --prefer-source,
    • and the same for any extension that is not bundled with MediaWiki,
    • php maintenance/update.php,
    • repeat the testing process as in 8),
    • I suggest that you update by one version at a time. Repeat until you reach REL1_35 which is the current stable release as of late 2020.

At each step you will need to consult many pages from https://mediawiki.org (about extensions, configuration variables and more general topics). That site will become your home page for quite a while. Every time you encounter a problem, do your best to solve it yourself; otherwise, you will not become a competent wiki admin.

Document everything you do, including configuring the web server, PHP, installing and configuring other software, installing extensions, to accelerate future upgrades and recovery procedures. You can use comments in your LocalSettings.php near the relevant configuration directives. Backup LocalSettings.php often.

Upvotes: 1

Related Questions