User:Aeric/Wiki Admin Guide

From AgileApps Support Wiki
< User:Aeric
Revision as of 18:00, 19 October 2011 by imported>Aeric (moved User:Aeric/Admin Guide to User:Aeric/Wiki Admin Guide)

How stuff works. See also User:Aeric/tests.

1 Background Information

User:Aeric/Background Information

2 Customizing the Wiki Look and Feel

User:Aeric/customizing

3 Backup Processes -- Deprecated

Warn.png

DEPRECATED: This process is now being handled by our uber:Admin, Matt.

3.1 Backup the mySQL Database

This is the first part of the weekly backup.

  • backupsql.php -- creates DB backup files in {curr_wiki}/dbbackup
http://lj.platformatyourservice.com/{curr_wiki}/backupsql.php
  • There is a nightly cron job in place on the standby server.
    __TBD: Remove the cron job. Use the cPanel options in Siteground to setup a backup cron job there.__

3.2 Backup the entire Wiki

This is the second part of the weekly backup. __TBD__

__TBD: ToDo: Copy all images into image-files/ directory.__

3.3 Historical Backup Retention Policy

  1. Open FileZilla
  2. Open the ftp site (see emailed instructions)
  3. Clean out extra backup files in /dbbackup/lj{curr_version}
    • Leave as many as seven (they take a lot of space)
    • Ideal Ages: 1 wk, 2 wks, 1 mo., 2 mo.s, 6 mo.., 1 yr, 2 yrs
  4. Create a local folder for backup. Ex: /042810
  5. Download all files from /www/{curr_wiki} Ex: /www/lj71

3.4 Restoring a Backup (optionally in a New Location)

Set up the wiki database:

  1. Create a MySQL database for the Wiki content, if one does not already exist.
  2. Unzip the backup file: gunzip xyz.sql.gz
  3. Import the wiki content into the database: mysql xyz.sql

Set up MediaWiki:

  1. Unzip the HTML backup in the new directory location:
    cd {wiki_root_dir}
    gunzip xyz.gz
    mv xyz {new_wiki_name} # Rename it, if desired
  2. Modify LocalSettings.php:
    • Complete the rename by telling the Wiki where it is:
      $wgScriptPath = "/path_from_server_root_to_wiki_dir";
    Ex: If the server root dir is /public_html, and the wiki is in /public_html/new, then the path to script dir is /new.
    • Tell the Wiki where the database is:
      $wgDBserver = "localhost";
      $wgDBname = "{new_DB_name}";
    On Siteground, the DB name is always {username}_{nameYouSpecified}. That name strategy prevents name-collisions in their shared environment.
    • Specify the username & password for the database:
      $wgDBuser = "{user}";
      $wgDBpassword = "{password}";

4 Rename the Wiki

User:Aeric/Rename the Wiki

5 Release a New Version of the Wiki

User:Aeric/Release a New Version

6 Create a New Branch

User:Aeric/Create a New Branch

7 Upgrading the Wiki

Notepad.png

Note: This process is for upgrading a wiki in place. The process hasn't been fully tested, as it turns out that to Create a New Branch it is necessary to install the wiki, so the paths are configured right internally. We tend to upgrade only when creating a new branch, so this process generally isn't needed. It has been retained in case it turns out to be useful at some future date.)

7.1 Do the Update

This upgrade process is based on the one recommended at the MediaWiki site.

  1. First, find out if an upgrade is needed. Check Special:Version to see what we have.
  2. Create a new directory to put the update into.
  3. If needed: Create a new database.
    (If you are doing the upgrade as part of creating a new branch, you have already created a new database, so you can skip this step.)
  4. Unzip the latest production version of MediaWiki.
    Get the latest stable production version (the latest version listed in green, or listed with a green checkmark, at
    http://en.wikipedia.org/wiki/MediaWiki_version_history.
  5. From the old directory:
    • Copy the LocalSettings.php file
    • Copy the extensions/ folder
    • Copy the skins/ folder
  6. In the release notes for the new version, see if any changes need to be made to LocalSettings.php.
    Note: It's possible that the upgrade script below does this. Maybe that's why it wasn't part of the procedure mentioned on the MediaWiki upgrade page. (Dunno)
  7. Enable read-only mode in LocalSettings.php of the old directory:
    • $wgReadOnly = 'Upgrading to MediaWiki {version}';
  8. Run the upgrade script in the new directory.
  9. Copy the images/ folder to the new directory.
  10. Swap the old directory and the new directory.

Learn more:

7.2 Test the update

Once the upgrade has been completed:

  1. Browse to the wiki and check that the following operations work as expected:
    • Viewing pages
    • Editing pages
    • Uploading a file
  2. In Special:Version, check that the version shown is correct and that the extensions are present.

8 Appendix: Apache Notes

8.1 Commands

RedHat commands worth knowing:

  • service httpd restart - Restart Apache (generally unnecessary. Sometimes useful, "just to be sure")
  • service httpd reload - Reload the configuration files

8.2 mediawiki.conf

The configuration file for MediaWiki is /etc/httpd/conf.d. mediawiki.conf, where:

  • etc (eht-cee) is the "et cetera" container for stuff added to the system
  • httpd is the HTTP Daemon (Apache)
  • conf.d is the directory of configuration files (all files in this directory are read by Apache when it starts or reloads.)

Warn.png

Important:
All files in that directory are processed, so make backup files elsewhere.

8.3 About that query string

Motivation
Pages with plain names seem to work properly. The incoming link is converted to the short URL form, and TOC entries have that form, as well.
But bookmarks that go to old pages that have :, /, or ! in them don't get a URL rewrite, because those characters don't seem to be handled by the URL-segment-at-a-time matching rules. (They must be MediaWiki matching rules, because Apache is *not* doing the redirect. MediaWiki is.)
Idea
We could make a redirect.php page that parses the query string, creates the new URL, and sends a 301-redirect back to the browser. That would be cool. But it's a fair amount of work for a few special pages that, over time, will no longer be bookmarked.