MediaWiki update script “mediawiki-updater”

Because repetative tasks bore me (my principle is: “If you have to do something twice, automate it. Every time you have to do it again increases the likeliness of doing it again.”), I have written a two scripts to automate the task “update MediaWiki”.

As I manage installations on both Linux and Windows I created a Bash and a PowerShell script.

The files (and their requirements) can be found in the following repo:

https://github.com/gpunktschmitz/mediawiki-updater

Here are the steps the scripts do:
1. check if a new release is available
2. backup the MySQL database
3. backup (copy) the current installation
4. download new MediaWiki release
5. extract new MediaWiki release into a temporary directory
6. overwrite current installation (files) with the new release
7. delete the directory “vendor”
8. clone the external libraries into the directory “vendor” using git
9. delete old backups (but keep the last 3)
10. run the script “maintenance/update.php”

While creating these I thought of running them by cron/scheduled task. They are not yet perfect for that – but I was able to successfully update my installations from version 1.28.2 to 1.29.0 by manually running them.

Hope it helps you automate that task also.

Leave a Reply

Your email address will not be published. Required fields are marked *