-
Notifications
You must be signed in to change notification settings - Fork 9
DevOps: Upgrading PostgreSQL Engine version
This guide is helpful when attempting to upgrade the postgreSQL version for our databases.
- Access to AWS management console
- Access to Jenkins
- Ensure it is approved in VA TRM
- Ensure that version is available in Amazon RDS via the AWS management console
- Ensure that version is available to download in the [PostgreSQL apt Repository]
-
Log in to the AWS management console
-
Go to RDS
![Screen Shot 2022-04-27 at 11 42 37 AM](https://user-images.githubusercontent.com/20211771/165576343-2d23a954-2667-42f9-96b0-96ba03ad19c9.png)
-
Click "Create database"
-
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](https://user-images.githubusercontent.com/20211771/165576638-bd934dda-a565-4f97-be1d-55b0f6ccd207.png)
- Scroll down to "Additional configuration
![Screen Shot 2022-04-27 at 11 47 31 AM](https://user-images.githubusercontent.com/20211771/165577087-fe0e2864-4e7c-46fd-a071-43048a9b7c2b.png)
- Turn off "Enable Enhanced monitoring"
![Screen Shot 2022-04-27 at 11 47 45 AM](https://user-images.githubusercontent.com/20211771/165577647-8b9f3082-7d93-48c0-8672-25410e0653f3.png)
- Turn off "Deletion protection"
![Screen Shot 2022-04-27 at 11 47 53 AM](https://user-images.githubusercontent.com/20211771/165577762-7e8ae8b6-e861-411b-8b6d-97e166f1e656.png)
-
Create the database
-
Once it successfully creates without issue, go ahead and delete the database.
-
Find Yaml file here https://github.com/department-of-veterans-affairs/diffusion-marketplace/actions/workflows/run-tests.yml
-
Run the build in to ensure tests continue to pass
-
Go to Amazon RDS and select the database identifier you want to upgrade.
-
click "Action"
-
click "Take Snapshot"
-
Snapshot name "dev-before-upgrade" or stage or Prod
-
click "Take snapshot" After snapshot has been taken, then follow 6-11 steps below
-
Click "Modify"
-
Select the DB version you want to upgrade to
![Screen Shot 2022-04-27 at 12 25 39 PM](https://user-images.githubusercontent.com/20211771/165584555-4d30a8f4-9bc5-4caf-bef8-ac9a696edef8.png)
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.
-
Click "Continue"
-
Under "Scheduling of modifications", select "Apply immediately"
![Screen Shot 2022-04-27 at 12 27 53 PM](https://user-images.githubusercontent.com/20211771/165584968-f9a04311-b400-4f44-b32d-a30ac87d4879.png)
-
Apply these changes, by clicking "Modify DB instance"
-
Apply these steps to the other databases.
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.