TEHCC Wiki:Maintenance: Difference between revisions
Jump to navigation
Jump to search
m (array define php command (easier future updates)) |
m (It worked - use everywhere) |
||
Line 44: | Line 44: | ||
#Composer based (Semantic MediaWiki, Maps, and Semantic Result Formats) | #Composer based (Semantic MediaWiki, Maps, and Semantic Result Formats) | ||
## <kbd>cd</kbd> to <code>cd ~/public_html/clubwiki/</code> directory (the one with LocalSettings.php). | ## <kbd>cd</kbd> to <code>cd ~/public_html/clubwiki/</code> directory (the one with LocalSettings.php). | ||
## Update composer <code> | ## Update composer <code>{{#arrayprint:phpcommand}} composer.phar self-update</code> | ||
## Update using composer <code> | ## Update using composer <code>{{#arrayprint:phpcommand}} composer.phar update --no-dev</code> | ||
# Composer extensions that need version number updated in <kbd>composer.json</kbd> <code>vi composer.json</code> | # Composer extensions that need version number updated in <kbd>composer.json</kbd> <code>vi composer.json</code> | ||
## [https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki Semantic MediaWiki] | ## [https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki Semantic MediaWiki] | ||
Line 51: | Line 51: | ||
## [https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/master/RELEASE-NOTES.md Semantic Result Formats] | ## [https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/master/RELEASE-NOTES.md Semantic Result Formats] | ||
## [https://github.com/SemanticMediaWiki/SemanticCompoundQueries/blob/master/RELEASE-NOTES.md Semantic Compound Queries] | ## [https://github.com/SemanticMediaWiki/SemanticCompoundQueries/blob/master/RELEASE-NOTES.md Semantic Compound Queries] | ||
## Rerun composer update if there were any updates to perform <code> | ## Rerun composer update if there were any updates to perform <code>{{#arrayprint:phpcommand}} composer.phar update --no-dev</code> | ||
# Manual extensions - Go to [[Special:Version]] and compare what's shown on extension page | # Manual extensions - Go to [[Special:Version]] and compare what's shown on extension page | ||
## [https://www.mediawiki.org/wiki/Extension:NumberFormat NumberFormat] - Download needed updates and extract into the extension directory <code>tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/</code> | ## [https://www.mediawiki.org/wiki/Extension:NumberFormat NumberFormat] - Download needed updates and extract into the extension directory <code>tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/</code> | ||
Line 59: | Line 59: | ||
## [https://www.mediawiki.org/wiki/Extension:MyVariables MyVariables] - Upload new version into extension folder | ## [https://www.mediawiki.org/wiki/Extension:MyVariables MyVariables] - Upload new version into extension folder | ||
# Remaining extensions are part of MediaWiki and upgraded with it | # Remaining extensions are part of MediaWiki and upgraded with it | ||
# Update completion - run maintenance routine from <code>cd ~/public_html/clubwiki/</code> directory: <code> | # Update completion - run maintenance routine from <code>cd ~/public_html/clubwiki/</code> directory: <code>{{#arrayprint:phpcommand}} maintenance/update.php</code> | ||
# Finish any residual jobs - run manual maintenance runJobs from <code>cd ~/public_html/clubwiki/</code> directory: <code> | # Finish any residual jobs - run manual maintenance runJobs from <code>cd ~/public_html/clubwiki/</code> directory: <code>{{#arrayprint:phpcommand}} maintenance/runJobs.php --maxjobs 1000</code> | ||
==Site Maintenance== | ==Site Maintenance== | ||
Cleanup after a spam/vandalism battle | Cleanup after a spam/vandalism battle | ||
# <kbd>cd</kbd> to <code>cd ~/public_html/clubwiki/</code> directory (the one with LocalSettings.php) | # <kbd>cd</kbd> to <code>cd ~/public_html/clubwiki/</code> directory (the one with LocalSettings.php) | ||
# Delete archived revisions (deleted page revisions) <code> | # Delete archived revisions (deleted page revisions) <code>{{#arrayprint:phpcommand}} maintenance/deleteArchivedRevisions.php</code> for dry run, then execute <code>{{#arrayprint:phpcommand}} maintenance/deleteArchivedRevisions.php --delete</code> | ||
# Delete users older than 7 days with no edits <code> | # Delete users older than 7 days with no edits <code>{{#arrayprint:phpcommand}} maintenance/removeUnusedAccounts.php --ignore-touched 7</code> for dry run, then execute <code>{{#arrayprint:phpcommand}} maintenance/removeUnusedAccounts.php --ignore-touched 7 --delete</code> |
Revision as of 07:24, 20 November 2018
Note! Any site specified use of php on the command line should replace php with /opt/php70/bin/php.
System Maintenance
Upgrade/Reinstall
Use to upgrade across major versions or to reinstall a borked install
- 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 Images folder (e.g.,
cp -R public_html/clubwiki/images/ ~/mediawiki stable release number/
) - Copy kml folder (e.g.,
cp -R public_html/clubwiki/kml/ ~/mediawiki stable release number/
)
- Copy Localsettings.php (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
- Install extensions/handlers
- Composer - per Mediawiki site download to clubwiki folder (e.g.
wget https://getcomposer.org/composer.phar
) - Semantic MediaWiki using Composer except syntax to use php v7.0 - Ensure to specify the most recent/desired version of software!
- NumberFormat - Download extension and extract into the extension directory
tar -xzf extension.tar.gz -C ~/public_html/clubwiki/extensions/
- Maps using Composer except syntax to use php v7.0. Start at step 2.
- Page Forms - Download extension and extract into the extension directory
tar -xzf extension.tar.gz -C ~/public_html/clubwiki/extensions/
- Semantic result formats using Composer except syntax to use php v7.0. Ensure you specify most recent/desired version!
- Semantic Compound Queries I tried to use Composer but it wasn't loading so manually installed at v1.1.0. Used for auto map of trails and parks
- Arrays - Simple extension download. Used for array manipulation in templates
- Header Tabs - Allows turning form pages (or really any page) into tabbed pages
- MyVariables - Allows referencing logged in user for form automation
- Composer - per Mediawiki site download to clubwiki folder (e.g.
- Run Mediawiki upgrade or command line update (per MediaWiki site)
- 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
- Composer based (Semantic MediaWiki, Maps, and Semantic Result Formats)
- cd to
cd ~/public_html/clubwiki/
directory (the one with LocalSettings.php). - Update composer
/opt/php70/bin/php composer.phar self-update
- Update using composer
/opt/php70/bin/php composer.phar update --no-dev
- cd to
- Composer extensions that need version number updated in composer.json
vi composer.json
- Semantic MediaWiki
- Maps - Note! v6 and above requires php v7.1 which is not on this host yet
- Semantic Result Formats
- Semantic Compound Queries
- Rerun composer update if there were any updates to perform
/opt/php70/bin/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
- 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:/opt/php70/bin/php maintenance/update.php
- Finish any residual jobs - run manual maintenance runJobs from
cd ~/public_html/clubwiki/
directory:/opt/php70/bin/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)
/opt/php70/bin/php maintenance/deleteArchivedRevisions.php
for dry run, then execute/opt/php70/bin/php maintenance/deleteArchivedRevisions.php --delete
- Delete users older than 7 days with no edits
/opt/php70/bin/php maintenance/removeUnusedAccounts.php --ignore-touched 7
for dry run, then execute/opt/php70/bin/php maintenance/removeUnusedAccounts.php --ignore-touched 7 --delete