TEHCC Wiki:Maintenance: Difference between revisions
(→Upgrade/Reinstall: note about maps quirk) |
(going to 1.38.6) |
||
Line 1: | Line 1: | ||
{{#arraydefine:phpcommand|php}}<!-- Load with any special directory specifying required to access desired version of php --> | {{#arraydefine:phpcommand|php}}<!-- Load with any special directory specifying required to access desired version of php --> | ||
{{#arraydefine:mwInstallVersion|mediawiki-1. | {{#arraydefine:mwInstallVersion|mediawiki-1.38.6}}<!-- Use to update examples to be useful --> | ||
'''Note!''' Current host doesn't have issue with calling old versions of php. So, when instructions call for <kbd>php</kbd> you can just use <kbd>{{#arrayprint:phpcommand}}</kbd>. The variable code left in, in the event that ever changes again. | '''Note!''' Current host doesn't have issue with calling old versions of php. So, when instructions call for <kbd>php</kbd> you can just use <kbd>{{#arrayprint:phpcommand}}</kbd>. The variable code left in, in the event that ever changes again. | ||
Revision as of 22:26, 10 May 2023
Note! Current host doesn't have issue with calling old versions of php. So, when instructions call for php you can just use php. The variable code left in, in the event that ever changes again.
Installed Extensions Reference
The following extensions are used for the listed purposes. GetUserName is left installed but not enabled in LocalSettings. MyVariables is throwing on error in debugging.
- Composer based extensions
- Composer - per Mediawiki site in wiki root folder. Used to install Composer packages and dependencies
- Semantic MediaWiki - whole site revolves around it
- Maps - For the embedded interactive maps
- Semantic result formats - permits semantic queries to other formats, I know array type is used by complex templates but I'm sure others have been used as well
- Semantic Compound Queries - permits advanced queries notably used in complex map templates
- Modern Timeline Result Format - Permits a more actively supported and better looking timeline for hike logs
- Manually installed extensions
- NumberFormat - Used to format numbers. SMW sum'd results are not natively able to be formatted.
- Page Forms - Makes the form editing of pages possible
- Arrays - Used for array creation and manipulation, including this page
- Header Tabs - Allows turning form pages (or really any page) into tabbed pages
- MyVariables - Allows referencing logged in user for form automation used for links and forms to hike logs and lists
- GetUserName - Alternative for MyVariables but doesn't have a "blank if not logged in" option or feature
- SimpleTable - Allows simple table definition, specifically easily working with a CSV list
- UrlGetParameters - Allows use of a GET parameter in a link to be used by the page code. Used for Hike Logs.
- MediaFunctions - Can retrieve location from photo EXIF (and other information). Planned use for map charting photos including maintenance needs.
System Maintenance
Upgrade/Reinstall
Use to upgrade across major versions or to reinstall after a borked update.
General wisdom is to wait for the x.1 release before upgrading.
Note! The example commands below are using a page array variable. Edit the page to update the variable for your target installation to ease copy-n-paste of commands. Examples currently using mediawiki-1.38.6.
- Precheck!
- These steps have worked for upgrades in the past, but a reality check with any new versions and MediaWiki's Upgrade Procedure is always prudent.
- Check requirements vs. what the current Version Page is showing!
- Primarily PHP as the host's slow version updating and PHP's aggressive deprecation have been a problem.
- Verify used extensions are compatible with the MediaWiki version you are moving to. SMW and Maps are two that hook deep and seemingly subject to version requirements. (SMW v4.0.2 supports up through MW 1.37).
- Run the Update extensions procedure below to ensure everything is up to date prior to upgrade. We will copy Composer and manual extensions from the current installation for ease of upgrade.
- Include running the maintenance update and runJobs.
- Get MediaWiki (per MediaWiki site)
- Download desired version from the MediaWiki Site using wget to the home directory
- Unpack using tar -xvzf (e.g.,
tar -xvzf mediawiki-1.38.6.tar.gz
) - Delete zipped tarball (e.g.,
rm mediawiki-1.38.6.tar.gz
)
- Copy customized files to new install (per MediaWiki site)
- Copy Localsettings.php (e.g.,
cp ~/public_html/clubwiki/LocalSettings.php mediawiki-1.38.6/
) - Copy kml folder (e.g.,
cp -R ~/public_html/clubwiki/kml/ mediawiki-1.38.6/
) - Copy Images folder (e.g.,
cp -R ~/public_html/clubwiki/images/ mediawiki-1.38.6/
)
- 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.38.6/extensions/
) - Copy HeaderTabs (e.g.,
cp -R ~/public_html/clubwiki/extensions/HeaderTabs/ mediawiki-1.38.6/extensions/
) - Copy MyVariables (e.g.,
cp -R ~/public_html/clubwiki/extensions/MyVariables/ mediawiki-1.38.6/extensions/
) - Copy GetUserName (e.g.,
cp -R ~/public_html/clubwiki/extensions/GetUserName/ mediawiki-1.38.6/extensions/
) - Copy NumberFormat (e.g.,
cp -R ~/public_html/clubwiki/extensions/NumberFormat/ mediawiki-1.38.6/extensions/
) - Copy PageForms (e.g.,
cp -R ~/public_html/clubwiki/extensions/PageForms/ mediawiki-1.38.6/extensions/
) - Copy SimpleTabs (e.g.,
cp -R ~/public_html/clubwiki/extensions/SimpleTable/ mediawiki-1.38.6/extensions/
) - Copy UrlGetParameters (e.g.,
cp -R ~/public_html/clubwiki/extensions/UrlGetParameters/ mediawiki-1.38.6/extensions/
) - Copy MediaFunctions (e.g.,
cp -R ~/public_html/clubwiki/extensions/MediaFunctions/ mediawiki-1.38.6/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-1.38.6/
) - Copy composer.phar (e.g.,
cp ~/public_html/clubwiki/composer.phar mediawiki-1.38.6/
)
- 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-1.38.6/ ~/public_html/clubwiki
- Move the existing installation to a temporary backup folder
- Finish by repeating Update extensions again. This will force composer to install composer packages and needed dependencies. Again include running the maintenance update and runJobs to complete the upgrade (instead of the web based upgrade).
- 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
- May need to ctrl-shift-R to force reload pages to avoid seeing errors
- Maps may instead display "Your browser is not compatible with Google Maps v3." but I think it goes away after a few minutes to hours.
- Done!
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-1.38.6.patch.gz
. - Use
patch -p1 --dry-run
to check what will be changed (e.g.,patch -p1 --dry-run -i mediawiki-1.38.6.patch
) - If all is well, run patch again without
--dry-run
(e.g.,patch -p1 -i mediawiki-1.38.6.patch
). - Update completion - run maintenance routine from
cd ~/public_html/clubwiki/
directory:php maintenance/update.php
- Check Special:Version and you should see the new version number in place.
- Delete patch files
rm mediawiki-1.38.6.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
- ModernTimeline
- 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 copy into PageForms directory
- wget extension
unzip extension.zip
cp -R folder unzip made/* ~/public_html/clubwiki/extensions/PageForms/
(remember the asterisk!)- Refresh Version page to confirm update worked
rm -rf folder unzip made/
rm extension.zip
- Arrays - Upload new version into extension folder
- Header Tabs - Upload new version into extension folder
- MyVariables - Upload new version into extension folder
- GetUserName - Upload new version into extension folder
- SimpleTable - Upload new version into extension folder
- UrlGetParameters - Upload new version into extension folder
- MediaFunctions - 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