TEHCC Wiki:Maintenance
Revision as of 08:33, 18 April 2020 by Tim (talk | contribs) (→Upgrade/Reinstall: update based on recent upgrade)
Note! On the command line, you no longer need to specify the location of the latest version of php. When it calls for php you simply use php.
System Maintenance
Upgrade/Reinstall
Use to upgrade across major versions or to reinstall a borked install
- Precheck!
- These steps have worked for upgrades in the past, but a reality check with any new versions is always prudent.
- Check requirements! Primarily PHP as the host updating and PHP's aggressive deprecation are a problem.
- Run the #Update extensions procedure below. We will move Composer and manual extensions from there for ease of upgrade.
- Include running the maintenance update and runJobs.
- Get MediaWiki (per MediaWiki site)
- Download desired version MediaWiki Site using wget to the home directory
- Unpack using tar -xvzf (e.g.,
tar -xvzf mediawiki stable release number.tar.gz
) - Delete zipped tarball (e.g.,
rm mediawiki stable release number.tar.gz
)
- Copy customized files to new install (per MediaWiki site)
- Copy Localsettings.php (e.g.,
cp public_html/clubwiki/LocalSettings.php ~/mediawiki stable release number/
) - Copy kml folder (e.g.,
cp -R public_html/clubwiki/kml/ ~/mediawiki stable release number/
) - Copy Images folder (e.g.,
cp -R public_html/clubwiki/images/ ~/mediawiki stable release number/
)
- Copy Localsettings.php (e.g.,
- Migrate manual extensions (Confirm this list is still accurate with the more actively used update procedure below)
- Copy Arrays (e.g.,
cp -R public_html/clubwiki/extensions/Arrays/ ~/mediawiki-1.34.1/extensions/
) - Copy HeaderTabs (e.g.,
cp -R public_html/clubwiki/extensions/HeaderTabs/ ~/mediawiki-1.34.1/extensions/
) - Copy MyVariables (e.g.,
cp -R public_html/clubwiki/extensions/MyVariables/ ~/mediawiki-1.34.1/extensions/
) - Copy NumberFormat (e.g.,
cp -R public_html/clubwiki/extensions/NumberFormat/ ~/mediawiki-1.34.1/extensions/
) - Copy PageForms (e.g.,
cp -R public_html/clubwiki/extensions/PageForms/ ~/mediawiki-1.34.1/extensions/
) - Copy SimpleTabs (e.g.,
cp public_html/clubwiki/extensions/SimpleTable.php ~/mediawiki-1.34.1/extensions/
)
- Copy Arrays (e.g.,
- Migrate Composer (can also follow Mediawiki recommendations, but if you updated extensions first, this should be fine)
- Copy composer.local.json (e.g.,
cp public_html/clubwiki/composer.local.json ~/mediawiki stable release number/
) - Copy composer.phar (e.g.,
cp public_html/clubwiki/composer.phar ~/mediawiki stable release number/
)
- Copy composer.local.json (e.g.,
- Move over to new install (per MediaWiki site)
- Move the existing installation to a temporary backup folder
mv ~/public_html/clubwiki/ ~/OLD.yyyymmdd.clubwiki
- Move the new installation to the public folder
mv ~/mediawiki stable release number ~/public_html/clubwiki
- Move the existing installation to a temporary backup folder
- Finish by repeating #Update extensions again. This will force composer to install needed dependencies, then the maintenance update will perform the database migration.
- Check Special:Version and a page or two to confirm things are still working.
- Lessons of the past...
- If upgrade stalls to white screen, likely a specified extension is not installed, check list and add as needed
- Done! (May need to ctrl-shift-R to force reload pages to avoid seeing errors)
Update MediaWiki
Patch - Available for point releases. Details on the MediaWiki site
- Download patch from the dumps site
- cd to
cd ~/public_html/clubwiki/
directory (the one with LocalSettings.php). - Download (wget) the patch file from the dumps site and gunzip it
gunzip mediawiki stable release number.patch.gz
. - Use
patch -p1 --dry-run
to check what will be changed (e.g.,patch -p1 --dry-run -i mediawiki stable release number.patch
) - If all is well, run patch again without
--dry-run
. - Check Special:Version and you should see the new version number in place.
- Delete patch files
rm mediawiki stable release number.patch*
Update extensions
NOTE: I have often got errors or configuration screens from the site after updating extensions. These are typically resolved by running the maintenance routine below. Sometimes a single browser temporarily refused to work, yet a different browser behaved normally.
- Composer based (Semantic MediaWiki, Maps, and Semantic Result Formats)
- cd to
cd ~/public_html/clubwiki/
directory (the one with LocalSettings.php). - Update composer
php composer.phar self-update
- Update using composer
php composer.phar update --no-dev
- cd to
- Composer extensions that need version number updated in composer.local.json
vi composer.local.json
- Semantic MediaWiki
- Maps
- Semantic Result Formats
- Semantic Compound Queries
- Rerun composer update if there were any updates to perform
php composer.phar update --no-dev
- Manual extensions - Go to Special:Version and compare what's shown on extension page
- NumberFormat - Download needed updates and extract into the extension directory
tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/
- Page Forms - Download extension and extract into the extension directory
tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/
- Arrays - Upload new version into extension folder
- Header Tabs - Upload new version into extension folder
- MyVariables - Upload new version into extension folder
- SimpleTable - Upload new version into extension folder
- NumberFormat - Download needed updates and extract into the extension directory
- Remaining extensions are part of MediaWiki and upgraded with it
- Update completion - run maintenance routine from
cd ~/public_html/clubwiki/
directory:php maintenance/update.php
- Finish any residual jobs - run manual maintenance runJobs from
cd ~/public_html/clubwiki/
directory:php maintenance/runJobs.php --maxjobs 1000
Site Maintenance
Cleanup after a spam/vandalism battle
- cd to
cd ~/public_html/clubwiki/
directory (the one with LocalSettings.php) - Delete archived revisions (deleted page revisions)
php maintenance/deleteArchivedRevisions.php
for dry run, then executephp maintenance/deleteArchivedRevisions.php --delete
- Delete users older than 7 days with no edits
php maintenance/removeUnusedAccounts.php --ignore-touched 7
for dry run, then executephp maintenance/removeUnusedAccounts.php --ignore-touched 7 --delete