GMC:Upgrading MediaWiki - Gallery Codex
Personal tools

GMC:Upgrading MediaWiki

From Gallery Codex

MediaWiki is managed in Subversion on GMC. We've made modifications to the MediaWiki code and we want to keep them through upgrades, so when a new version of MediaWiki is released we want to make sure that we have a controlled upgrade process. The way we do this is by maintaining a vendor branch for the code from MediaWiki, and a trunk branch that contains the version of MediaWiki we're using with our modifications. When a new release of MediaWiki comes out, we commit that to the vendor branch, then use subversion to merge it into the trunk code. All of this is done on the staging server -- once that works properly we commit the changes to subversion, go to the production server and update it from subversion.

Because this is a public wiki, I've used fake paths.

Here are the steps:

  1. cd /var/www/test-mw.gallery2.org
  2. wget http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.##.#.tar.gz
  3. cd vendor && find . -type f | xargs rm Remove all existing files from the vendor branch
  4. tar --strip-components=1 -xzf ../mediawiki-1.#.#.tar.gz Unpack the tarball and strip remove the first directory from all paths. now use use "svn st" and "svn diff" to assure yourself that everything looks ok
  5. svn st Any files marked with (!) were deleted in this new release. Anything marked with (?) are new files. svn add and svn remove files as necessary.
  6. svn commit -m "Update to MediaWiki 1.#.#" svn returns "YYY" as the change list id at this point the vendor branch is up to date. Now we can begin merging. If svn reports a message like "inconsistent eol style for a file" try doing a svn propdel svn:eol-style for that file so that we don't do conversions.
  7. cd /var/www/test-mw.gallery2.org
  8. svn merge -cYYY vendor trunk This merges all MediaWiki changes into our trunk it probably generates some conflicts. For each conflict, edit the file, resolve the conflict and then do "svn resolved" on each conflicted file.
  9. svn diff Take a look at the diffs and make sure they look as expected.
  10. php maintenance/update.php Run the updater, make sure everything is ok, then test the dev site to make sure that the code around the diffs is ok.
  11. svn commit -m "Update to MediaWiki 1.#.#" Now the dev site is up to date
  12. cd /var/www/codex.galleryproject.org
  13. svn up Now the live site has the latest code
  14. chmod 644 bumper.html if you want to disable the site while you run the update script
  15. php maintenance/update.php Now the latest site is up to date. Sanity check it.