CNPG Backups and Restores on Helm Platforms
Requirements
S3 Provider Setup
Adding Credentials
You can add the credentials by copy-pasting the Full Examples section in the common-docs and adapting those accordingly
CNPG Database Backups
CNPG-backed PostgreSQL databases have their own S3 backup system.
For each chart:
-
Add CNPG backups to each database you want backed up
-
Add the name you gave to the S3 credentials earlier, under the
credentials
section -
Confirm the data is being sent to your S3 host after ~5 minutes
-
We advise you to set the “mode” to
recovery
, this should prevent the app starting with an empty database upon recovery.
It will look something like this:
CNPG Database Restore
Before CNPG will correctly restore the database, the following modifications need to be done after recreating or importing the app configuration:
-
Ensure you’ve setup CNPG backups as well as recovery as it was previously
-
Ensure the “mode” is set to
recovery
-
Set “revision” on your restore to match the previous revision setting on your backup settings
-
Increase the revision on your backup setting by 1 (or set to 1 if previously empty)
It will look something like this:
Total System Restore and Migration to New System
When on a completely new system, you can easily restore using the above steps with the following caveats:
- The PVC backend needs to support snapshots
- The apps need to be called exactly the same as they were before, and use exactly the same values.yaml structure
- If you’ve any non-PVC storage attached, be sure that this is still available or apps won’t start until this is resolved.