TEHCC Wiki:Maintenance: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
m (→‎Upgrade/Reinstall: example code for copying)
Line 11: Line 11:
# Copy customized files to new install (per [https://www.mediawiki.org/wiki/Manual:Upgrading MediaWiki site])
# Copy customized files to new install (per [https://www.mediawiki.org/wiki/Manual:Upgrading MediaWiki site])
## Copy Localsettings.php (''e.g.'', <code>cp public_html/clubwiki/LocalSettings.php ~/''mediawiki stable release number''</code>)
## Copy Localsettings.php (''e.g.'', <code>cp public_html/clubwiki/LocalSettings.php ~/''mediawiki stable release number''</code>)
## Copy Images folder (''e.g.'', <code>cp -R public_html/clubwiki/kml/ ~/''mediawiki stable release number''</code>)
## Copy Images folder (''e.g.'', <code>cp -R public_html/clubwiki/images/ ~/''mediawiki stable release number''</code>)
## Copy kml folder (''e.g.'', <code>cp -R public_html/clubwiki/images/ ~/''mediawiki stable release number''</code>)
## Copy kml folder (''e.g.'', <code>cp -R public_html/clubwiki/kml/ ~/''mediawiki stable release number''</code>)
# Move over to new install (per [https://www.mediawiki.org/wiki/Manual:Upgrading MediaWiki site])
# Move over to new install (per [https://www.mediawiki.org/wiki/Manual:Upgrading MediaWiki site])
##Move the existing installation to a temporary backup folder <code>mv ~/public_html/clubwiki/ ~/public_html/OLD.yyyymmdd.clubwiki</code>
##Move the existing installation to a temporary backup folder <code>mv ~/public_html/clubwiki/ ~/public_html/OLD.yyyymmdd.clubwiki</code>

Revision as of 08:43, 3 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

  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 (e.g., cp public_html/clubwiki/LocalSettings.php ~/mediawiki stable release number)
    2. Copy Images folder (e.g., cp -R public_html/clubwiki/images/ ~/mediawiki stable release number)
    3. Copy kml folder (e.g., cp -R public_html/clubwiki/kml/ ~/mediawiki stable release number)
  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 v7.0.
    2. Semantic MediaWiki using Composer except syntax to use php v7.0 - 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 using Composer except syntax to use php v7.0. 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 using Composer except syntax to use php v7.0. Ensure you specify most recent/desired version!
    7. 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
    8. Arrays - Simple extension download. Used for array manipulation in templates
    9. Header Tabs - Allows turning form pages (or really any page) into tabbed pages
  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 (Semantic MediaWiki, Maps, and Semantic Result Formats)
    1. cd to cd ~/public_html/clubwiki/ directory (the one with LocalSettings.php).
    2. Update composer /opt/php70/bin/php composer.phar self-update
    3. Update using composer /opt/php70/bin/php composer.phar update --no-dev
  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/
    2. Page Forms - Download extension and extract into the extension directory tar -xzf extension.tar.gz -C public_html/clubwiki/extensions/
    3. Arrays - Upload new version into extension folder
    4. Header Tabs - Upload new version into extension folder
  3. Remaining extensions are part of MediaWiki and upgraded with it
  4. Update completion - run maintenance routine from cd ~/public_html/clubwiki/ directory: /opt/php70/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) /opt/php70/bin/php maintenance/deleteArchivedRevisions.php for dry run, then execute /opt/php70/bin/php maintenance/deleteArchivedRevisions.php --delete
  3. 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