⚠️
This documentation is for Rhize v4.0.0. If you don’t need a specific version, switch to the latest documentation
Restore Audit backup
This guide shows you the procedure to restore your Audit PostgreSQL database in your Rhize Kubernetes deployment.
Prerequisites
Before you start, ensure you have the following:
Also, before you start, confirm you are in the right context and namespace.
## context
kubectl config current-context
## namespace
kubectl get namespaceTo change the namespace for all subsequent kubectl commands to libre, run this command:
kubectl config set-context --current --namespace=libreSteps
To restore Audit PostgreSQL, follow these steps:
Steps
Confirm the cluster and namespace are correct:
## context kubectl config current-context ## namespace kubectl get namespaceTo change the namespace for all subsequent
kubectlcommands tolibre, run this command:kubectl config set-context --current --namespace=libreRetrieve the Audit user password using the following command:
kubectl get secret <SECRET-NAME> -o jsonpath="{.data.<SECRET-KEY>}" | base64 --decodeExtract your backup file:
gzip -d audit-postgres-backup-YYYYMMDDTHHMMAA.sqlRestore the backup:
cat audit-postgres-backup-YYYYMMDDTHHMMAA.sql | kubectl exec -i audit-postgres-0 -- psql postgresql://postgres:<DB_PASSWORD>@localhost:5432 -U <DB_USER_NAME>
Next Steps
- Test the Backup Audit procedure
- Plan and execute a Maintenance Strategy to handle your audit data.