Update KnowPulse

The following documentation outlines the steps and testing that should be done when updating KnowPulse, whether it be simply updating a custom module or updating Drupal itself. Updating between major versions (e.g. Drupal 7 => 8 or Tripal 2 => 3) is beyond the scope of this document.

The following are the basic steps to be taken. There is more information below if needed.

  1. Create a fresh clone (Dev Fresh) of the production site

  2. Upgrade the clone.

    • In the directory for the site, execute drush up. This will tell you what modules need to be updated and prompt you to do so. Remember, if you don’t have permission on the directory you will need to use sudo.
  3. Test the upgrade by checking the pages listed under “To be Checked” below.

  4. If there are no errors (check the current page, the recent log messages and the apache error log) then upgrade the production site using the same steps.

  5. Check the pages listed under “To be Checked” on the production site as well.

Pages To Be Checked

This list should be ever expanding. Feel free to document the specifics under each page.

Create a Clone of KP

Note

Replace *** with the name of the database user in all the commands below.

  1. Backup the production site to your home directory
    • pg_dump kp3_production --user *** --host thunder > ~/kp3_production.2017Aug18.sql
  2. Remove the existing Clone. This should be safe since no one is supposed to develop on the clone. That said, it wouldn’t hurt to tell your collegues that you’re about to delete everything on the clone ;-)
    • sudo rm -R dev/fresh
    • psql --user *** --host thunder --command "DROP DATABASE kp3_fresh"
  3. Re-create the clone database and restore the production site backup to it.
    • psql --user *** --host thunder --command "CREATE DATABASE kp3_fresh WITH OWNER ***"
    • psql kp3_fresh --user *** --host thunder < ~/kp3_production.2017Aug18.sql
  4. Copy the production site files to dev/fresh.
    • sudo cp -R ../portal fresh
    • sudo chown -R lacey-local:www-dev fresh/
  5. Change the database in the dev/fresh/sites/default/settings.php from kp3_production to kp3_fresh.
    • You need to use sudo to change this file.
  6. Change the write permission of dev/fresh/sites/default/files to be writable by all.
    • sudo chmod 777 files/