Skip to content

Database Backup and Restore

Sanjay Babu edited this page Jul 12, 2024 · 16 revisions

Update Backup Container

Change the version to the latest release in backup-postgres yaml and save:
https://console.apps.silver.devops.gov.bc.ca/k8s/ns/d9d78e-<env>/cronjobs/backup-postgres/yaml

Recover Database

1. Perform the following steps from css-backup-container-wiki

Manual Run
Acquire Backup
Connect to Remote DB
Wipe Existing DB

2. Restore database

run: gunzip <backup_file_name>
open up the sql file in VSCode and comment out the following lines:
– CREATE ROLE app;
– CREATE ROLE postgres;
– CREATE ROLE replication;
run: psql -h localhost -p 5432 -U postgres -d app -f <backup_file_name>.sql

Clone this wiki locally