Skip to main content

Backup and Recovery

It is highly recommended to perform backups of the database and Helm chart values before any upgrade, or before any operation that might change the behaviour. These backups allow you to recover the platform to its previous state if something fails.

Backup the database

The first step is to back up the current database. Use the pg_dump command or any other backup tool to create a reliable backup.

pg_dump -h localhost -p 5432 \
-d ilmdb \
-U ilmuser \
-W > [date]_ilmdb_backup_[comment].sql

The backup file will be created as [date]_ilmdb_backup_[comment].sql. Store this file safely.

Backup current Helm chart values

Helm chart values are crucial for the recovery process in case the upgrade fails. If you do not already have the values file saved, you can retrieve the current Helm values using:

helm get values ilm -n ilm > ilm-values-[current version].yaml

This will output the Helm values to ilm-values-[current version].yaml. Store this file alongside the database backup.

For further details, refer to the Helm documentation on helm get values.

Restore database

If an upgrade failure occurs, start by restoring the database.

Create a new database:

CREATE DATABASE ilmdb ENCODING 'UTF8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;
GRANT ALL PRIVILEGES ON DATABASE ilmdb to ilmuser;

Restore the backup using the psql command:

psql -h localhost -p 5432 \
-d ilmdb \
-U ilmuser \
-W ilmdb < [date]_ilmdb_backup_[comment].sql &> psql_log

Restore the platform

To restore the platform to its previous state:

  1. Use the original Helm chart values (backed up earlier).
  2. Install the previous version of the platform using Helm:
helm install --namespace ilm \
-f ilm-values-[current version].yaml ilm \
oci://hub.omnitrustregistry.com/ilm-helm/ilm \
--version [current version]
  1. Monitor the installation to ensure it completes successfully.

For detailed instructions on Helm-based deployments, refer to the Helm Deployment Guide.