Jump to content

CAPipedia Sandbox:Updating CAPipedia: Difference between revisions

From CAPipedia Sandbox
No edit summary
No edit summary
Line 1: Line 1:
== Test the new version deployment prior to upgrading in production ==
== Test the new version deployment prior to upgrading in production ==


1. Download and uncompress the new version's distribution from mediawiki.org
# Download and uncompress the new version's distribution from mediawiki.org
2. Run the `refresh-sandbox.sh` script from the user home directory
# Run the `refresh-sandbox.sh` script from the user home directory
3. Replace the distribution files using the command: `cp -pR mediawiki-[version]/* sandbox.capmembers.wiki`
# 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`
# 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 and the page fully loads without errors
# Browse to https://sandbox.capmembers.wiki/wiki/Special:Version and verify the upgrade took effect and the page fully loads without errors
6. Check that the following operations work as expected:
# Check that the following operations work as expected:
 
## Viewing pages
a. Viewing pages
## Editing pages
b. Editing pages
## Uploading a file
c. Uploading a file


== Backup the production site ==
== Backup the production site ==


1. Place production site in read only mode by uncommenting the `$wgReadOnly` variable in the `LocalSettings.php` file of the old directory
# Place production site in read only mode by uncommenting the `$wgReadOnly` variable in the `LocalSettings.php` file of the old directory
2. Return to the user home directory
# Return to the user home directory
3. Run `backup-prod.sh`
# Run `backup-prod.sh`


== Create a new production site ==
== Create a new production site ==


1. Duplicate the production folder using the command: `cp -pR capipedia-[old_version] capipedia-[new_version]`
# 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]`
# Replace the distribution files using the command: `cp -pR mediawiki-[version]/* capipedia-[new_version]`
3. From the [https://panel.dreamhost.com DreamHost Web Panel], browse to **Websites**/**MySQL Databases**
# From the [https://panel.dreamhost.com DreamHost Web Panel], browse to **Websites**/**MySQL Databases**
4. Create a new database with a database name that matches the new directory name and new username of `cap_wiki_root`
# Create a new database with a database name that matches the new directory name and new username of `cap_wiki_root`
5. Upload the backup database file to the database by running the command: `mysql -ucap_wiki_root -p -hmysql.sandbox.capmembers.wiki [new_db_name] < [backup_sql_file]`
# Upload the backup database file to the database by running the command: `mysql -ucap_wiki_root -p -hmysql.sandbox.capmembers.wiki [new_db_name] < [backup_sql_file]`
6. Change the `$wgDBname` variable in the `LocalSettings.php` file of the new directory to the new database name
# Change the `$wgDBname` variable in the `LocalSettings.php` file of the new directory to the new database name
7. From the new capipedia version directory, run the command: `php maintenance/run.php update`
# From the new capipedia version directory, run the command: `php maintenance/run.php update`


== Switch the production hostname to the new site ==
== Switch the production hostname to the new site ==


1. From the [https://panel.dreamhost.com DreamHost Web Panel], browse to **Websites**/**Manage Websites**/**Settings**/**Directories: Modify** and change the root web directory to the new version
# From the [https://panel.dreamhost.com DreamHost Web Panel], browse to **Websites**/**Manage Websites**/**Settings**/**Directories: Modify** and change the root web directory to the new version
2. Wait for **Updating Web Options...** to complete
# Wait for **Updating Web Options...** to complete
3. Browse to https://sandbox.capmembers.wiki/wiki/Special:Version and verify the upgrade took effect and the page fully loads without errors
# Browse to https://sandbox.capmembers.wiki/wiki/Special:Version and verify the upgrade took effect and the page fully loads without errors
4. Place production site back in write mode by commenting the `$wgReadOnly` variable in the `LocalSettings.php` file of the new directory
# Place production site back in write mode by commenting the `$wgReadOnly` variable in the `LocalSettings.php` file of the new directory
4. Check that the following operations work as expected:
# Check that the following operations work as expected:
 
## Viewing pages
a. Viewing pages
## Editing pages
b. Editing pages
## Uploading a file
c. Uploading a file

Revision as of 11:21, 16 April 2025

Test the new version deployment prior to upgrading in production

  1. Download and uncompress the new version's distribution from mediawiki.org
  2. Run the `refresh-sandbox.sh` script from the user home directory
  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 and the page fully loads without errors
  6. 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 old directory
  2. Return to the user home directory
  3. Run `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 the new directory name and new username of `cap_wiki_root`
  5. Upload the backup database file to the database by running the command: `mysql -ucap_wiki_root -p -hmysql.sandbox.capmembers.wiki [new_db_name] < [backup_sql_file]`
  6. Change the `$wgDBname` variable in the `LocalSettings.php` file of the new directory to the new database name
  7. From the new capipedia version directory, run the command: `php maintenance/run.php update`

Switch 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 the new version
  2. Wait for **Updating Web Options...** to complete
  3. Browse to https://sandbox.capmembers.wiki/wiki/Special:Version and verify the upgrade took effect and the page fully loads without errors
  4. Place production site back in write mode by commenting the `$wgReadOnly` variable in the `LocalSettings.php` file of the new directory
  5. Check that the following operations work as expected:
    1. Viewing pages
    2. Editing pages
    3. Uploading a file