Backup & Restore
The appliance keeps all of its state in two PostgreSQL databases and a handful
of files under /opt/sysward, so standard PostgreSQL tooling is all you need.
What to back up
syswarddatabase — your organizations, users, agents, groups, jobs, and history. This is the data that matters.cvedatabase — synced vulnerability data. Backing it up is optional; thesysward-cveservice re-syncs it over time./opt/sysward/.env— your license key and configuration (including any SMTP settings).- Your SSL certificate —
/opt/sysward/sysward.certand/opt/sysward/sysward.key, if you installed a custom certificate.
Taking a backup
As root on the appliance:
cd /opt/sysward
source .env
pg_dump "$DATABASE_URL" > sysward-backup.sql
pg_dump "$CVE_DB_URL" > cve-backup.sql # optional
cp .env env-backup
Copy the resulting files off the appliance (for example with scp) and store
them somewhere safe. Schedule this with cron for regular backups.
Restoring
Restore onto a fresh appliance install — run the normal installation on the new server first, then:
Stop the application services:
systemctl stop sysward sysward-cveLoad your backup into the new
syswarddatabase:cd /opt/sysward source .env psql "$DATABASE_URL" < sysward-backup.sql(Restore
cve-backup.sqlinto$CVE_DB_URLthe same way if you backed it up; otherwise the CVE service repopulates it automatically.)Re-apply any custom settings from your old
.env(SMTP settings, for example) to the new/opt/sysward/.env— don’t overwrite the new file wholesale, since it contains the database credentials generated for this install.Restore your custom SSL certificate if you had one, then start everything back up:
systemctl start sysward sysward-cve systemctl restart nginx
Your agents will resume checking in against the restored data — if the appliance’s IP or hostname changed, update your agents’ configuration to point at the new address.
