Restoring from a Backup

The instructions below assume a fresh Scrutinizer instance was deployed on the same Scrutinizer and postgres version as the backup was taken on. Upload the backup files to the /var/lib/pgsql/backup/ directory.

Important

You MUST be restoring to the same version of PostgreSQL that was used during the backup.

  1. Stop all Scrutinizer services.
sudo service scrutinizer stop
  1. Delete the current database files.
sudo rm -Rf /var/db/big/pgsql/data/* /var/db/fast/pgsql_tmp/*
  1. Restore the base.tar.gz backup files.
sudo mv /var/lib/pgsql/backup/base.tar.gz /var/db/big/pgsql/data/
sudo tar -zxvf /var/db/big/pgsql/data/base.tar.gz -C /var/db/big/pgsql/data
  1. Restore The WAL.
sudo mv /var/lib/pgsql/backup/pg_wal.tar.gz /var/db/big/pgsql/data/pg_wal/
sudo tar -zxvf /var/db/big/pgsql/data/pg_wal/pg_wal.tar.gz -C /var/db/big/pgsql/data/pg_wal
  1. Restore The ‘fast’ TABLESPACE. Keep in mind that the number for the fast TABLESPACE will vary from system to system. In my example, it’s 16385.
sudo mv /var/lib/pgsql/backup/16385.tar.gz /var/db/fast/pgsql_tmp/
sudo tar -zxvf /var/db/fast/pgsql_tmp/16385.tar.gz -C /var/db/fast/pgsql_tmp
  1. Start The PostgreSQL service. If it doesn’t start, please contact Plixer support before continuing.
sudo service plixer_db start
  1. It’s common for database passwords to be different across a backup and restore. Run the following commands and reset the database passwords to ensure they are in sync:
scrut_util
set password scrutdb
services all restart
  1. Register the collector with the new IP address. By moving the database, it is possible for the IP to change on the destination host. We need to ensure the collector service is aware of the new IP.
scrut_util
set selfregister reset
  1. Check SSL Configuration. If you are not using SSL for the web interface on the source or destination servers, you can skip this step.
scrut_util
set ssl off
set ssl on
  1. Apply a new license key. When changing hosts, Scrutinizer needs a new license key. In the web interface of the restoration host, navigate to Admin -> Settings -> Licensing, copy the Machine ID and contact Plixer support for a new license. Once you receive the new license key, in the web interface of the restoration host, navigate to Admin -> Settings -> Licensing and apply the new license.
  2. Before deleting the backup, it is recommended to verify the restored system is collecting new flow data and that you can report on the restored historical data.If you changed the IP, you may need to point your exporters to the IP address of the new collector.
  3. Once you’re confident the database has been restored, remove the backup tarballs from the server.
sudo rm /var/db/fast/pgsql_tmp/16385.tar.gz var/db/big/pgsql/data/pg_wal/pg_wal.tar.gz /var/db/big/pgsql/data/base.tar.gz