Skip to content

DevOps: Upgrading PostgreSQL Engine version

Emmanuel Nwakire edited this page Nov 13, 2024 · 1 revision

Update PostgreSQL version

Purpose

This guide is helpful when attempting to upgrade the postgreSQL version for our databases.

Prerequisites

  • Access to AWS management console
  • Access to Jenkins

Steps

Determine PostgreSQL version to upgrade to

Check version is available in Amazon RDS

  1. Log in to the AWS management console

  2. Go to RDS

Screen Shot 2022-04-27 at 11 42 37 AM
  1. Click "Create database"

  2. Select "PostgreSQL" and drop down to the version approved by the TRM and the one you want to upgrade to

Screen Shot 2022-04-27 at 11 46 05 AM
  1. Scroll down to "Additional configuration
Screen Shot 2022-04-27 at 11 47 31 AM
  1. Turn off "Enable Enhanced monitoring"
Screen Shot 2022-04-27 at 11 47 45 AM
  1. Turn off "Deletion protection"
Screen Shot 2022-04-27 at 11 47 53 AM
  1. Create the database

  2. Once it successfully creates without issue, go ahead and delete the database.

Update the version in Github Action CI workflow file config

  1. Find Yaml file here https://github.com/department-of-veterans-affairs/diffusion-marketplace/actions/workflows/run-tests.yml

  2. Run the build in to ensure tests continue to pass

Upgrade the databases in RDS

  1. Go to Amazon RDS and select the database identifier you want to upgrade.

  2. click "Action"

  3. click "Take Snapshot"

  4. Snapshot name "dev-before-upgrade" or stage or Prod

  5. click "Take snapshot" After snapshot has been taken, then follow 6-11 steps below

  6. Click "Modify"

  7. Select the DB version you want to upgrade to

Screen Shot 2022-04-27 at 12 25 39 PM

Note: If the version you want to upgrade to is initially not there you may need to update it to the closest major version. After that version update is complete, you should be able to upgrade it to the minor version you want.

  1. Click "Continue"

  2. Under "Scheduling of modifications", select "Apply immediately"

Screen Shot 2022-04-27 at 12 27 53 PM
  1. Apply these changes, by clicking "Modify DB instance"

  2. Apply these steps to the other databases.

Additional steps

You will most likely need to make changes to the "Backup PROD DB" and "Backup PROD DB and Refresh STG and DEV DBs" scripts in Jenkins especially if it is a major change in version number.

Clone this wiki locally