Updating a really old mediawiki is a pain and should be done in several steps, according to diagram on https://www.mediawiki.org/wiki/Compatibility.
Also update should be incremental because of the new mediawiki policy:
Since Version 1.36, MediaWiki only commits to supporting upgrades from two LTS releases ago (see phab:T259771). Upgrades from older versions of MediaWiki will have to be performed in multiple steps. This means that if you want to upgrade to 1.41 from 1.34 or earlier, you'll first have to upgrade your 1.34 wiki to 1.35 (or 1.39), and, from 1.35 (or 1.39), you'll be able to upgrade to 1.41.
Simply because current OS versions don't support old PHP versions and necessary PHP extensions.
Basic docker php images don't work because they don't contain needed PHP extensions.
Building a docker image for old php versions is a bit complex since many repos and certificates already stopped existing. Making a working php 5.6 container is already a challenge.
Mediawiki provides some docker images, but only for versions 1.39+, so it's useless for upgrade:
UPD: It appears that I was wrong, official mediawiki README does not list old versions as supported, and I did not list all the tags. Now I see that there are images from 1.29+, so you can possibly use those. May be those dont't really work or are unextendable. Anyway, if you wanna build new images then this repo and images may be useful.
So I've gone through it and wanted to share docker images for php-fpm that can help to update from 1.24 to 1.41 version.
You are free to use my docker compose, nginx and mysql docker files, or any another you like. I used Mysql 5.7 because it is compatible with all wiki versions I saw.
- Make a full backup of your database, file system and images
- Use docker compose or pull image according to your wiki version, for example
ghcr.io/jehy/php-fpm-mediawiki_1.24:latest
, and deploy your current version using it (import database dump and copy wiki files tohome
volume). - Make sure everything is alright
- Update php-fpm to next version, for example
ghcr.io/jehy/php-fpm-mediawiki_1.35:latest
- Copy new wiki version files to your web server
- Run maintenance update script
- Make sure everything is alright
- Repeat 4-7 until you have latest version :)
ghcr.io/jehy/php-fpm-mediawiki_1.24:latest
ghcr.io/jehy/php-fpm-mediawiki_1.35:latest
ghcr.io/jehy/php-fpm-mediawiki_1.41:latest
# export sql backup
docker exec mysqlContainerName /usr/bin/mysqldump -u userName --password=Password dbName > backup.sql
# import SQL backup
cat backup.sql | docker exec -i mysqlContainerName mysql -u userName --password=Password dbName
# rebuild images
docker exec -i phpContainerName php /var/www/public_html/maintenance/rebuildImages.php
# enter container shell
docker exec -it phpContainerName sh
#run update script inside container
cd /var/www/public_html/maintenance/
php ./update.php
# reinstall composer deps if they are broken in downloaded gzip
cd /var/www/public_html/
rm ./vendor/* -rf
composer install