I use latest MediaWiki (either on Arch Linux or Debian stable) in a personal project - I'm the only one who works on it, and I use MediaWiki in a core-only way (I don't install any extensions whatsoever).

  • I'd like the core version to always be upgraded to enjoy all newest features.

  • I have daily/weekly backups.

  • I tried to read here but I didn't recognize anything about automatic upgrades.

What is the correct way to have automatic upgrades for MediaWiki?

BTW, This is how I upgrade all my Drupal apps in a given Debian-based environment; maybe a similar approach can be taken for MediaWiki in Arch Linux:


cat <<-EOF > /etc/cron.daily/cron_daily
    for dir in ${drt}/*/; do
        if pushd "$dir"; then
                composer update drupal/* webflo/drupal-core-require-dev --with-dependencies
                drush updatedb
                drush cache:rebuild
    done 2> $HOME/myErrors

cat <<-EOF > /etc/cron.weekly/cron_weekly
    find "$drt" -path "*/cache/*" -type f -delete
    certbot renew -q

chmod +x /etc/cron{.daily,.weekly}
  • A cron job to run pacman -Syu mediawiki ? – aksh1618 Jan 9 '19 at 15:20
  • I plan to have at least 2 MediaWiki in one document root directory. I don't recognize how this could help (though I never used Arch before and might be wrong). – user149572 Jan 9 '19 at 17:07
  • Have you installed from Git? That can make it easier to script upgrades. – Sam Wilson Jan 9 '19 at 17:51
  • I've yet to ever install it, but I guess I'll install it from a zip, but how should I automatically upgrade it afterwards? – user149572 Jan 9 '19 at 18:07
  • Update your files, run composer update, run maintenance/update.php. – Tgr Jan 9 '19 at 21:22

The standard upgrade process is:

  1. Update the files. If you are using git, this will be something like git checkout REL1_32. If you are using a tarball, you can just uncompress it over an old one (although for a live server a better approach is to have a separate directory for the old and new version, and use symlinks to swap them out so it's fast and easy to undo if something goes wrong).
  2. Update dependencies. If you use git, run composer update in the MediaWiki root directory. If you use the vendor repo (probably a bad idea), do a git checkout on it as well. If you use a tarball, it probably includes the updated dependencies (running composer doesn't harm though).
  3. Run the upgrade script: php maintenance/update.php --quick.

If it's a live wiki used by others, you probably want to set $wgReadOnly for the process (or even better to lock users out entirely).

There's a doc page but like most things on mediawiki.org it's a bit too verbose...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy