Manual backup process

PostgreSQL

This requires direct access to the PostgreSQL server from the machine on which the backup is done:

PGPASSWORD=<password> pg_dump -O -h <hostname> -U <username> <dbname> > <date>.sql
BASH

InfluxDB

The command for backing up the InfluxDB is the following:

influxd backup -portable -host <hostname>:8088 -database <dbname>
CODE

Manual restore process

Hibernating the Tenant by adding the option `hibernate: true` to the tenant's global configuration section and reapplying the tenant configuration:

global:
  name: ...
  hibernate: true

  ...

... 
CODE

This config can then be applied with the following command:

helm upgrade -f <tenant-name>.yaml <tenant-name> <chart>
CODE

After a few moments, use kubectl again to check if the tenant is fully hibernated:

kubectl get pods -n <tenant>
CODE

There should not be any pods left in the tenant (evicted pods can be ignored). Once the tenant is fully hibernated, the databases can be restored.

Restoring PostgreSQL

First ensure that the schema is cleared and any existing (possibly corrupted) data is deleted:

PGHOST=<host> PGPASSWORD=<password> PGUSER=<user> PGDATABASE=<dbname> psql -qAtX -c "DROP SCHEMA IF EXISTS %s CASCADE;"
CODE

Then, the actual backup can be applied:

PGHOST=<host> PGPASSWORD=<password> PGUSER=<user> PGDATABASE=<dbname> psql -f <filename>
CODE

Restoring InfluxDB

For restoring influxdb, simply run:

influxd restore -portable -host <hostname>:8088 <backup-dir>
CODE

Dehibernating the tenant

Remove the `hibernate=true` section from the config file again and apply the tenant's configuration again (see above for specific steps).