VM backup guide↑
This guide explains how to backup the database for a single AQtive Guard VM installation.
Requirements↑
- AQtive Guard version 23.09.10 or higher.
- Root access on the VM.
- Adequate disk space to perform the backup. Make sure you have enough free disk space for a copy of the database (50GB is typically sufficient for most clients).
There are two main steps to backup a VM:
- Back up the database.
- Back up the files.
Back up the database↑
Run the following commands as root on the VM:
export LD_LIBRARY_PATH=/opt/cryptosense-analyzer/postgres/lib
export PATH=/opt/cryptosense-analyzer/postgres/bin/:$PATH
pg_dump -U cryptosense-analyzer --format c --file cap-backup.sql -h /var/run/cryptosense-analyzer-database cryptosense-analyzer
mv cap-backup.sql /etc/cryptosense-analyzer/
For versions of AQtive Guard released before v24.01.0, replace this command for both backup and restore:
export LD_LIBRARY_PATH=/opt/cryptosense-analyzer/postgresql/usr/local/pgsql/lib
Back up the files↑
Back up the following backup folders from the VM to a location of your choice.
/etc/cryptosense-analyzer/
/var/lib/cryptosense-analyzer/object-storage/
Restoring from a backup↑
There are four main steps to restore from a backup:
- Install AQtive Guard.
- Copy the files you previously backed up.
- Import the database.
- Reboot the VM.
Install AQtive Guard↑
You’ll need to make sure the VM has AQtive Guard installed. Refer to Single machine installation for more details.
Copy the files↑
Copy the folders that you previously backed up back onto the VM:
/etc/cryptosense-analyzer/
/var/lib/cryptosense-analyzer/object-storage/
Import the database↑
Import the database by restoring the backup. Run the following commands as root on the VM:
export LD_LIBRARY_PATH=/opt/cryptosense-analyzer/postgres/lib
export PATH=/opt/cryptosense-analyzer/postgres/bin/:$PATH
pg_restore -U cryptosense-analyzer -h /var/run/cryptosense-analyzer-database/ --format c --dbname cryptosense-analyzer --clean /etc/cryptosense-analyzer/cap-backup.sql
For versions of AQtive Guard released before v24.01.0, replace this command for both backup and restore:
export LD_LIBRARY_PATH=/opt/cryptosense-analyzer/postgresql/usr/local/pgsql/lib
Reboot the VM↑
On the VM, run: sudo cs restart
.