-
Notifications
You must be signed in to change notification settings - Fork 43
Disaster Recovery
Database backups are configured to be created daily. The database backup pod also provides a way through scripts to perform adhoc backup, verification and restore functions.
Access to the database pod can be achieved either through the UI OpenShift or the OC CLI. Both will allow you to perform all functions available.
To use the web UI, login into OpenShift. Select the namespace (dev, test, prod) that you want to interact with. Find the backup pod and click the Terminal tab. At this point you will be able to interact with the backup script SSH information below.
To use the OC CLI, get an access token. This can be done through the web UI, by clicking your user name, and then clicking the "Copy Login Command". Now paste the login command into a termainal window.
oc login https://console.pathfinder.gov.bc.ca:8443 --token={access token}
Change the namespace that you are in to the appropriate one (example below is prod).
oc project jcxjin-prod
Get the pod name of the database backup container.
oc get pods
Copy the pod name of the backup-mssql
container.
oc rsh {pod name}
You are now SSH'd into the database backup pod container.
For help using the database backup script type the following command.
./backup.sh -h
To run an adhoc backup of the database use the following command. More information related to backup options can be read here
./backup.sh -1
To run an adhoc restore of a database use the following command. This will restore the most recent backup. Syntax for the command can be read in the before mentioned help, and here.
You can find the connection information by looking at the Resource/Config Maps in OpenShift. Look at the backup-conf Config Map. This information is also found within source code - here
./backup.sh -r mssql=pims-database:1433/pims
You can also specify a specific backup to restore with the -f {backup name}
parameter.
./backup.sh -r mssql=pims-database:1433/pims -f {backup name/path}