IT/Software/Mediawiki/Upgrading Mediawiki

From msgwiki
< IT‎ | Software‎ | Mediawiki
Revision as of 11:07, 27 September 2023 by Walttheboss (talk | contribs) (Create msgwiki upgrade steps page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Create backup of wiki database

mysqldump --user=msgwiki --password=password msgwiki > msgwikibackup.sql

Create backup of wiki files

sudo mv /var/www/html/msgwiki /var/www/html/msgwiki-backup

Download latest version

mkdir -p /var/www/html/msgwiki
cd /var/www/html/msgwiki
wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz
tar xvzf mediawiki-1.40.0.tar.gz
mv mediawiki-1.40.0/* .
rm -d mediawiki-1.40.0
rm mediawiki-1.40.0.tar.gz
chown -R www-data:www-data .

Move old files over

cp /var/www/html/msgwiki-backup/LocalSettings.php .
cp -R ../msgwiki-last-version/images/* images
chown -R www-data:www-data images
cp -R ../msgwiki-last-version/extensions/* extensions/
# Extensions can break over new versions. Be aware.

Update the database

cd maintenance
sudo -u www-data php update.php
sudo chown -R www-data:www-data /var/www/html/msgwiki

Debug any issues. This will likely include updating extensions. Here you can choose an extension and get a download link to its latest version. Replace the extension's files in the extensions directory.