How to upgrade mediawiki

From Mass Pirate Wiki
Revision as of 15:20, 10 December 2016 by Srevilak (talk | contribs) (initial revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Our wiki installation is cloned from mediawiki's git repository. Mediawiki has branches for each release; we have branches that track mediawiki branches.

In general, the Masspirates mediawiki is the standard mediawiki distribution, plus a couple of commits (for changes to LocalSettings.php and such).

For example:

 $ git status
 On branch mapp-1.28
 Your branch is ahead of 'origin/REL1_28' by 2 commits.
   (use "git push" to publish your local commits)
 $ git branch
 * mapp-1.28
   master

Above, mapp-1.28 is based on mediawiki's REL1_28 branch, and there are a few changes on top. Upgrading follows one of two procedures:

  1. Pulling in changes from the same branch. In this case, just rebase
  2. Switching to a new branch. Here, we want to make a new (local) branch off the new upstream release, and cherry pick

That's the overview. I'll go into more detail below.

General Process

With that said, the upgrade involves five steps.

  1. Backup the database
  2. upgrade code
  3. run maintenance/update.php
  4. update composer's dependencies
  5. resolve any changes to configuration variables.

We'll go through these steps one at a time

Database Backup

 mysqldump --verbose -uUSER -pPASSWD --complete-insert=1 DBNAME | gzip -9 > masspira_mdw1.$(date +%F).sql.gz
 mv *.sql.gz backup

Update Code

Rebasing from the same branch

 git status  # should be no outstanding changes
 git remote update
 git rebase origin/REL1_28

Above, substitute "origin/REL1_28" with the actual upstream branch.

Having done this,

 git log --oneline origin/REL1_28..HEAD

lists the local changes we've made.

Switching to a new Release branch

(to be written)

Running Maintainance Scripts

 $ php maintenance/update.php

Update composer dependencies

 $ ~/bin/composer update

Resolving Changes to Configuration Variables

For this step, look at the "UPGRADE" and "RELEASE-NOTES" files in mediawiki's root directory. It's a good idea to look through these files anyway, to see what changes are in the new release.