Configuration backups¶
For more “lightweight” backup and restore operations, the scrut_conf_dump.sh
and scrut_conf_restore.sh
scripts (both located in /home/plixer/scrutinizer/database/utils
) can be used to target only the application/configuration data of a Plixer Scrutinizer instance, including:
User-added maps
Dashboards
IP groups
Saved reports
3rd-party integration settings
Configuration backups do not include any collected flow data.
Note
In distributed environments, the primary reporter regularly syncs application/configuration data to remote collectors. Only the configuration backup of the primary reporter is needed to perform a restore for the cluster.
scrut_conf_dump.sh
and scrut_conf_restore.sh
use Postgres’s pg_dump and pg_restore utils and respect the same set of environment variables:
Variable |
Description |
Default |
---|---|---|
|
Location of the backup file |
|
|
IP address or hostname of the PostgreSQL database |
|
|
Role/user used to connect to PGHOST |
|
|
The database to access at PGHOST |
|
Note
To avoid potential issues, use the services command to stop the plixer_flow_collector
service before attempting to restore from a configuration backup.
Backing up configuration data¶
To create a backup of a Plixer Scrutinizer server’s current configuration data, run the following script:
~/scrutinizer/database/utils/scrut_conf_dump.sh
To dump configuration data to a specified location/file:
mkdir /tmp/CONF_BACKUP_DIR touch /tmp/CONF_BACKUP_DIR/CONF_BACKUP.dump DUMP=/tmp/CONF_BACKUP_DIR/CONF_BACKUP.dump ~/scrutinizer/database/utils/scrut_conf_dump.sh
Restoring configuration data¶
To restore configuration data to a Plixer Scrutinizer server from a backup file, run the following script:
~/scrutinizer/database/utils/scrut_conf_restore.sh
To restore configuration data from a specified dump file:
PGHOST=42.42.42.42 DUMP=/tmp/CONF_BACKUP_DIR/CONF_BACKUP.dump ~/scrutinizer/database/utils/scrut_conf_restore.sh
Important
The scrut_conf_restore.sh
script is meant to be used for restoring configuration data for the same Plixer Scrutinizer server/appliance. To apply a configuration backup to a different server, follow the steps for backup migrations in the migration guides.
Additional notes
pg_restore
errors typically only cause the restore to fail for the table associated with the error. Other tables should still be restored successfully.Errors associated with duplicate keys usually indicate a conflict between existing rows in the table and the rows being restored.
pg_restore: [archiver (db)] Error from TOC entry 51348; 0 17943 TABLE DATA exporters plixer pg_restore: [archiver (db)] COPY failed for table "exporters": ERROR: duplicate key value violates unique constraint "exporters_pkey" DETAIL: Key (exporter_id)=(\x0a4d4d0a) already exists.
The conflicting keys should be removed from the table before attempting to restore again.
If you are swapping IP addresses, the database keys should be rotated using
scrut_util --pgcerts --verbose
, because the backed up keys will be associated with the old address.