1

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:

#!/bin/bash

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

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

chmod +x /etc/cron{.daily,.weekly}
13
  • A cron job to run pacman -Syu mediawiki ? Commented Jan 9, 2019 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). Commented Jan 9, 2019 at 17:07
  • Have you installed from Git? That can make it easier to script upgrades. Commented Jan 9, 2019 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? Commented Jan 9, 2019 at 18:07
  • Update your files, run composer update, run maintenance/update.php. Commented Jan 9, 2019 at 21:22

1 Answer 1

1
+100

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...

0

You must log in to answer this question.