Jump to content

CAPipedia:Updating CAPipedia

From CAPipedia

Review the upgrading manual document

Review https://www.mediawiki.org/wiki/Manual:Upgrading before performing the update to note any special callouts to be considered during the update process.

Test the new version deployment prior to upgrading in production

  1. Download and uncompress the new version's distribution from https://mediawiki.org
  2. Run this command from the user home directory:
    sh refresh-sandbox.sh
  3. Replace the distribution files using the command:
    cp -pR mediawiki-[version]/* sandbox.capmembers.wiki
  4. From the sandbox.capmembers.wiki directory, run the command:
    php maintenance/run.php update
  5. Browse to https://sandbox.capmembers.wiki/wiki/Special:Version and verify the upgrade took effect (version shown on the page matches the distribution) and the page fully loads without errors
  6. For each skin and extension that has a Git hash for its version, go to that skin or extension directory and run the following commands:
    git pull
    git checkout REL[minor_version] (e.g., REL1_43)
  7. Check that the following operations work as expected:
    1. Viewing pages
    2. Editing pages
    3. Uploading a file

Backup the production site

  1. Place production site in read only mode by uncommenting the $wgReadOnly variable in the LocalSettings.php file of the capipedia-[old_version] directory
  2. Return to the user home directory
  3. Run this command:
    sh backup-prod.sh

Create a new production site

  1. Duplicate the production folder using the command:
    cp -pR capipedia-[old_version] capipedia-[new_version]
  2. Replace the distribution files using the command:
    cp -pR mediawiki-[version]/* capipedia-[new_version]
  3. From the DreamHost Web Panel, browse to Websites/MySQL Databases
  4. Create a new database with a database name that matches capipedia-[new_version] and new username of cap_wiki_root (leave password blank)
  5. Upload the backup database file to the newly created database by running the command:
    sh load-database.sh [new_db_name] [backup_sql_file]
  6. Obtain the password from the LocalSettings.php file
  7. Change the $wgDBname variable in the LocalSettings.php file in the capipedia-[new_version] directory to the new database name
  8. From the capipedia-[new_version] directory, run the command:
    php maintenance/run.php update

Retarget the production hostname to the new site

  1. From the DreamHost Web Panel, browse to Websites/Manage Websites/Settings/Directories: Modify and change the root web directory to capipedia-[new_version]
  2. Wait for Updating Web Options... to complete
  3. Browse to https://capipedia.cap.gov/wiki/Special:Version and verify the upgrade took effect (version shown on the page matches the distribution) and the page fully loads without errors
  4. For each skin and extension that has a Git hash for its version, go to that skin or extension directory and run the following commands:
    git pull
    git checkout REL[version] (e.g., REL1_43)
  5. Place production site back in write mode by commenting the $wgReadOnly variable in the LocalSettings.php file of the capipedia-[new_version] directory
  6. Check that the following operations work as expected:
    1. Viewing pages
    2. Editing pages
    3. Uploading a file

Clean up server home directory

  1. Delete the mediawiki-[version] folder and .gz distribution file
  2. Delete the capipedia-[old_version]_backup .gz and .sql files

Update local-attributes.sh

  1. Edit the local-attributes.sh file and change the PROD_DIR to capipedia-[new_version] and PROD_DB_NAME to the new version's database name

Final decommission of old version

  1. After the warranty period (no less than 2 weeks), delete the capipedia-[old_version] directory and database