docs/deploy/backups.md

Backups and restore

Everything Vocion knows is in two places: Postgres (records, conversations, runs, credentials, the durable executor's state) and your workspace git repo (agents, skills, rules). Media and artifact files are the third, smaller piece.

WhatWhereBack it up by
DatabasePostgres (DATABASE_URL)Snapshots / point-in-time recovery, or pg_dump
Workspace definitionsYour workspace git repoGit; re-apply with workspace:apply
Uploaded mediaS3 bucket (VOCION_MEDIA_BUCKET)Bucket versioning
Artifact filesVOCION_ARTIFACTS_DIRVolume snapshots
Credential vault keyKMS key, or VOCION_CREDENTIAL_VAULT_KEYKeep it: without it, stored credentials can't be decrypted

With vocion-stack

  • RDS automated backups with point-in-time recovery for db_backup_retention_days (7).
  • AWS Backup: a daily backup (cron(0 3 * * ? *)) into a vault encrypted under the module's data key, kept backup_retention_days (35), locked in governance mode so no recovery point is deleted early.
  • Cross-account copy (backup_copy_vault_arn) sends each backup to a vault in another account, once cross-account backup is on for your AWS organization and the destination accepts it.
  • The media bucket is versioned. The host holds no data: replacing it loses nothing.

On the older single-host path

infra/aws takes daily EBS snapshots kept seven days. Add a nightly pg_dump to S3 for anything you can't afford to lose.

Restore

  1. Restore the database to a new instance (RDS point-in-time restore or an AWS Backup recovery point), or psql a dump into an empty database with vector enabled.
  2. Point DATABASE_URL at it and deploy the same release that wrote the backup.
  3. Make sure the same vault key is available (VOCION_KMS_KEY_ARN or VOCION_CREDENTIAL_VAULT_KEY).
  4. If the workspace files moved on since, re-apply them.

Test a restore before you need one.