TEHCC Wiki:Maintenance: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
(→‎System Maintenance: Added reinstall/upgrade section - crap formatting but good enough for now)
(Further refine and detail)
Line 1: Line 1:
Maintenance notes:
'''Note!''' Any site specified use of php on the command line should replace <kbd>php</kbd> with <kbd>/usr/php/56/bin/php</kbd>.


==System Maintenance==
==System Maintenance==
* Update MediaWiki
** Patch - Available for point releases. Details on the [https://www.mediawiki.org/wiki/Manual:Upgrading#Using_patch MediaWiki site]
**# Download patch from the [http://dumps.wikimedia.org/mediawiki/ dumps site]
**# <kbd>cd</kbd> to <code>cd ~/public_html/clubwiki/</code> directory (the one with LocalSettings.php).
**# Download (<kbd>wget</kbd>) the patch file from the [http://dumps.wikimedia.org/mediawiki/ dumps site] and <kbd>gunzip</kbd> it <code>gunzip ''mediawiki stable release number.patch''.gz</code>.
**# Use <code>patch -p1 --dry-run</code> to check what will be changed (''e.g.'', <code>patch -p1 --dry-run -i ''mediawiki stable release number.patch''</code>)
**# If all is well, run <kbd>patch</kbd> again without <code>--dry-run</code>.
**# Check [[Special:Version]] and you should see the new version number in place.
**# Delete patch files <code>rm ''mediawiki stable release number.patch''*</code>


* Upgrade/Reinstall - use to upgrade across major versions or to reinstall a borked install
===Upgrade/Reinstall===
*# Download desired version [https://www.mediawiki.org/wiki/Download MediaWiki Site] using <kbd>wget</kbd> to the home directory
Use to upgrade across major versions or to reinstall a borked install
*# Unpack using <kbd>tar -xvzf<kbd> (''e.g.'', <code>tar -xvzf ''mediawiki stable release number.tar.gz''</code>)
# Get MediaWiki (per [https://www.mediawiki.org/wiki/Manual:Upgrading MediaWiki site])
*# Delete zipped tarball (''e.g.'', <code>rm ''mediawiki stable release number.tar.gz''</code>)
## Download desired version [https://www.mediawiki.org/wiki/Download MediaWiki Site] using <kbd>wget</kbd> to the home directory
*# Move the existing installation to a temporary backup folder <code>mv ~/public_html/clubwiki/ ~/public_html/OLD.yyyymmdd.clubwiki</code>
## Unpack using <kbd>tar -xvzf</kbd> (''e.g.'', <code>tar -xvzf ''mediawiki stable release number.tar.gz''</code>)
*# Move the new installation to the public folder <code>mv ~/''mediawiki stable release number'' ~/public_html/clubwiki</code>
## Delete zipped tarball (''e.g.'', <code>rm ''mediawiki stable release number.tar.gz''</code>)
*# Copy Localsettings.php (to be detailed later)
# Copy customized files to new install (per [https://www.mediawiki.org/wiki/Manual:Upgrading MediaWiki site])
*# Copy Images folder (to be detailed later)
## Copy Localsettings.php (to be detailed later)
*# Install extensions/handlers (to be detailed later)
## Copy Images folder (to be detailed later)
**# Composer
# Move over to new install (per [https://www.mediawiki.org/wiki/Manual:Upgrading MediaWiki site])
**# Semantic mediawiki
##Move the existing installation to a temporary backup folder <code>mv ~/public_html/clubwiki/ ~/public_html/OLD.yyyymmdd.clubwiki</code>
**# NumberFormat
## Move the new installation to the public folder <code>mv ~/''mediawiki stable release number'' ~/public_html/clubwiki</code>
**# Maps
# Install extensions/handlers
**# Page Forms
## [https://getcomposer.org/download/ Composer] except syntax to use php v5.6.
**# Semantic result formats
## [https://www.semantic-mediawiki.org/wiki/Help:Installation/Using_Composer_with_MediaWiki_1.25%2B Semantic MediaWiki] except syntax to use php v5.6 - Ensure to specify the most recent/desired version of software!
*# Run Mediawiki upgrade or command line update
## [https://www.mediawiki.org/wiki/Extension:NumberFormat NumberFormat] - Download extension and extract into the extension directory <code>tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/</code>
*# Done!
## [https://github.com/JeroenDeDauw/Maps/blob/master/INSTALL.md Maps] except syntax to use php v5.6. Start at step 2.
## [https://www.mediawiki.org/wiki/Extension:Page_Forms/Download_and_installation Page Forms] - Download extension and extract into the extension directory <code>tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/</code>
## [https://www.semantic-mediawiki.org/wiki/Semantic_Result_Formats Semantic result formats] except syntax to use php v5.6. Ensure you specify most recent version
# Run Mediawiki upgrade or command line update (per [https://www.mediawiki.org/wiki/Manual:Upgrading MediaWiki site])
# Done!


* Update extensions
===Update MediaWiki===
** Composer based (Semantics, others?)
Patch - Available for point releases. Details on the [https://www.mediawiki.org/wiki/Manual:Upgrading#Using_patch MediaWiki site]
**# <kbd>cd</kbd> to <code>cd ~/public_html/clubwiki/</code> directory (the one with LocalSettings.php).
# Download patch from the [http://dumps.wikimedia.org/mediawiki/ dumps site]
**# Update composer <code>/usr/php/56/bin/php composer.phar self-update</code>
# <kbd>cd</kbd> to <code>cd ~/public_html/clubwiki/</code> directory (the one with LocalSettings.php).
**# Update using composer <code>/usr/php/56/bin/php composer.phar update</code>
# Download (<kbd>wget</kbd>) the patch file from the [http://dumps.wikimedia.org/mediawiki/ dumps site] and <kbd>gunzip</kbd> it <code>gunzip ''mediawiki stable release number.patch''.gz</code>.
** Manual extensions - Go to [[Special:Version]] and compare what's shown on extension page
# Use <code>patch -p1 --dry-run</code> to check what will be changed (''e.g.'', <code>patch -p1 --dry-run -i ''mediawiki stable release number.patch''</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>
# If all is well, run <kbd>patch</kbd> again without <code>--dry-run</code>.
***; Note<nowiki>:</nowiki> [[Special:Version]] currently shows v0.8.0, but site shows v0.8.1, updating doesn't increment.
# Check [[Special:Version]] and you should see the new version number in place.
** Remaining extensions are part of MediaWiki and upgraded with it
# Delete patch files <code>rm ''mediawiki stable release number.patch''*</code>


* Update completion - run maintenance routine from <code>cd ~/public_html/clubwiki/</code> directory: <code>/usr/php/56/bin/php maintenance/update.php</code>
===Update extensions===
#Composer based (Semantics, others?)
## <kbd>cd</kbd> to <code>cd ~/public_html/clubwiki/</code> directory (the one with LocalSettings.php).
## Update composer <code>/usr/php/56/bin/php composer.phar self-update</code>
## Update using composer <code>/usr/php/56/bin/php composer.phar update</code>
# 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>
##; Note<nowiki>:</nowiki> [[Special:Version]] currently shows v0.8.0, but site shows v0.8.1, updating doesn't increment.
## [https://www.mediawiki.org/wiki/Extension:Page_Forms/Download_and_installation Page Forms] - Download extension and extract into the extension directory <code>tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/</code>
# Remaining extensions are part of MediaWiki and upgraded with it
# Update completion - run maintenance routine from <code>cd ~/public_html/clubwiki/</code> directory: <code>/usr/php/56/bin/php maintenance/update.php</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>/usr/php/56/bin/php maintenance/deleteArchivedRevisions.php</code> for dry run, then execute <code>/usr/php/56/bin/php maintenance/deleteArchivedRevisions.php --delete</code>
# Delete archived revisions (deleted page revisions) <code>/usr/php/56/bin/php maintenance/deleteArchivedRevisions.php</code> for dry run, then execute <code>/usr/php/56/bin/php maintenance/deleteArchivedRevisions.php --delete</code>
*# Delete users older than 7 days with no edits <code>/usr/php/56/bin/php maintenance/removeUnusedAccounts.php --ignore-touched 7</code> for dry run, then execute <code>/usr/php/56/bin/php maintenance/removeUnusedAccounts.php --ignore-touched 7 --delete</code>
# Delete users older than 7 days with no edits <code>/usr/php/56/bin/php maintenance/removeUnusedAccounts.php --ignore-touched 7</code> for dry run, then execute <code>/usr/php/56/bin/php maintenance/removeUnusedAccounts.php --ignore-touched 7 --delete</code>

Revision as of 22:06, 23 November 2016

Note! Any site specified use of php on the command line should replace php with /usr/php/56/bin/php.

System Maintenance

Upgrade/Reinstall

Use to upgrade across major versions or to reinstall a borked install

  1. Get MediaWiki (per MediaWiki site)
    1. Download desired version MediaWiki Site using wget to the home directory
    2. Unpack using tar -xvzf (e.g., tar -xvzf mediawiki stable release number.tar.gz)
    3. Delete zipped tarball (e.g., rm mediawiki stable release number.tar.gz)
  2. Copy customized files to new install (per MediaWiki site)
    1. Copy Localsettings.php (to be detailed later)
    2. Copy Images folder (to be detailed later)
  3. Move over to new install (per MediaWiki site)
    1. Move the existing installation to a temporary backup folder mv ~/public_html/clubwiki/ ~/public_html/OLD.yyyymmdd.clubwiki
    2. Move the new installation to the public folder mv ~/mediawiki stable release number ~/public_html/clubwiki
  4. Install extensions/handlers
    1. Composer except syntax to use php v5.6.
    2. Semantic MediaWiki except syntax to use php v5.6 - Ensure to specify the most recent/desired version of software!
    3. NumberFormat - Download extension and extract into the extension directory tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/
    4. Maps except syntax to use php v5.6. Start at step 2.
    5. Page Forms - Download extension and extract into the extension directory tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/
    6. Semantic result formats except syntax to use php v5.6. Ensure you specify most recent version
  5. Run Mediawiki upgrade or command line update (per MediaWiki site)
  6. Done!

Update MediaWiki

Patch - Available for point releases. Details on the MediaWiki site

  1. Download patch from the dumps site
  2. cd to cd ~/public_html/clubwiki/ directory (the one with LocalSettings.php).
  3. Download (wget) the patch file from the dumps site and gunzip it gunzip mediawiki stable release number.patch.gz.
  4. Use patch -p1 --dry-run to check what will be changed (e.g., patch -p1 --dry-run -i mediawiki stable release number.patch)
  5. If all is well, run patch again without --dry-run.
  6. Check Special:Version and you should see the new version number in place.
  7. Delete patch files rm mediawiki stable release number.patch*

Update extensions

  1. Composer based (Semantics, others?)
    1. cd to cd ~/public_html/clubwiki/ directory (the one with LocalSettings.php).
    2. Update composer /usr/php/56/bin/php composer.phar self-update
    3. Update using composer /usr/php/56/bin/php composer.phar update
  2. Manual extensions - Go to Special:Version and compare what's shown on extension page
    1. NumberFormat - Download needed updates and extract into the extension directory tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/
      Note: Special:Version currently shows v0.8.0, but site shows v0.8.1, updating doesn't increment.
    2. Page Forms - Download extension and extract into the extension directory tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/
  3. Remaining extensions are part of MediaWiki and upgraded with it
  4. Update completion - run maintenance routine from cd ~/public_html/clubwiki/ directory: /usr/php/56/bin/php maintenance/update.php

Site Maintenance

Cleanup after a spam/vandalism battle

  1. cd to cd ~/public_html/clubwiki/ directory (the one with LocalSettings.php)
  2. Delete archived revisions (deleted page revisions) /usr/php/56/bin/php maintenance/deleteArchivedRevisions.php for dry run, then execute /usr/php/56/bin/php maintenance/deleteArchivedRevisions.php --delete
  3. Delete users older than 7 days with no edits /usr/php/56/bin/php maintenance/removeUnusedAccounts.php --ignore-touched 7 for dry run, then execute /usr/php/56/bin/php maintenance/removeUnusedAccounts.php --ignore-touched 7 --delete