IT/Software/Mediawiki/Upgrading Mediawiki: Difference between revisions

From msgwiki
< IT‎ | Software‎ | Mediawiki
Jump to navigation Jump to search
Access restrictions were established for this page. If you see this message, you have no access to this page.
m (Add reference link)
m (Add more debugging info)
 
Line 25: Line 25:
  sudo -u www-data php update.php
  sudo -u www-data php update.php
  sudo chown -R www-data:www-data /var/www/html/msgwiki
  sudo chown -R www-data:www-data /var/www/html/msgwiki
Debug any issues. This will likely include updating extensions. [[mediawikiwiki:Special:ExtensionDistributor|Here]] you can choose an extension and get a download link to its latest version. Replace the extension's files in the extensions directory.
Debug any issues.  
 
This will likely include updating extensions. [[mediawikiwiki:Special:ExtensionDistributor|Here]] you can choose an extension and get a download link to its latest version. Replace the extension's files in the extensions directory.
 
Issues will likely include vague errors. Add the line
$wgShowExceptionDetails = true;
to LocalSettings.php to see more detail. Then, check any backtraces and see if they include extensions. Update those extensions.
 
Make sure to remove the line afterwards.

Latest revision as of 11:10, 27 September 2023

Reference: https://www.mediawiki.org/wiki/Manual:Upgrading


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.

Issues will likely include vague errors. Add the line

$wgShowExceptionDetails = true;

to LocalSettings.php to see more detail. Then, check any backtraces and see if they include extensions. Update those extensions.

Make sure to remove the line afterwards.