VM migration guide↑
This guide explains how to migrate the database for a single AQtive Guard VM installation.
Requirements↑
- AQtive Guard version 23.09.10 or higher
- Root access on both the starting and target VMs
- Adequate disk space to perform the migration
- Starting VM - must have enough free disk space for a copy of the database (50GB is typically sufficient for most clients)
- Target VM - should be twice the size of the database plus have enough additional free disk space for all the traces
Caution
Both VMs must have the same version of AQtive Guard installed.
Migration↑
There are four main steps to complete VM migration:
- Back up the database.
- Transfer files to the new VM.
- Import the database.
- Reboot the new VM.
The following sections provide instructions for each step.
Back up the database↑
Run the following commands as root on the original 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
Transfer files↑
Transfer the following backup folders from the old VM to the new one. Keep the file structure identical and overwrite any existing files in the new 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 original 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 new VM↑
On the new VM, run: sudo cs restart
.