For the complete documentation index, see llms.txt. This page is also available as Markdown.

Backup and Restore

What Must Be Backed Up

The PostgreSQL insightly database contains all Hivel data. There is no separate object store to back up in the self-hosted deployment. The database is the complete backup target.

Backup Strategy

Recommended frequency: Daily Recommended retention: 7 days of dumps

Adjust this cadence to match your compliance or operational requirements.

Live-backup safety: pg_dump takes a transactionally consistent snapshot at the moment it starts. It is safe to run against the live database without stopping services or pausing integration polling.

Recommended backup command:

pg_dump -h $DB_HOST -U postgres -d insightly -F c -f /backups/insightly_$(date +%Y-%m-%d).dump

Set this as a daily cron job to automate backups.

Restore from Backup

When you need to restore from a backup:

Step 1: Stop Services

On the host, run:

./deploy.sh --stop

Step 2: Restore the Database

On the host, run:

Replace <date> with the backup date.

Step 3: Repoint .env and Restart Services (if needed)

If the restored database now lives on a different host or uses different credentials, update .env:

Update DB_HOST and/or DB_PASSWORD as needed.

Then restart services:

  • If you changed .env values: ./deploy.sh --vm

  • If you did not change .env: ./deploy.sh --start

Step 4: Re-evaluate Permissions

Once services are back up, run the following against your deployment's API base URL. This re-evaluates permissions so anything derived from the restored data (roles, access grants) is consistent with the restored state.

Application/Location: Run from any machine with network access to Hivel API

Replace <base-url> with your deployment's actual API base URL.

Step 5: Validate the Restore

Application/Location: Host (via SSH)

Complete the validation checklist from Verification and Access.

Last updated