-
-
Notifications
You must be signed in to change notification settings - Fork 205
Backups Restore and Retention
A backup is useful only when it is consistent, verified, protected, and restorable. CCAM provides two related mechanisms with different goals.
| Artifact | Best for | Important property |
|---|---|---|
| SQLite online backup | Disaster recovery of a deployment | Exact database-level recovery |
| Versioned JSON export | Moving or merging supported dashboard records | Idempotent, non-destructive import; not a byte-for-byte restore |
The deployment helper uses SQLite's online backup API and verifies integrity:
./deployments/scripts/db-backup.sh \
--env production \
--namespace agent-monitor-production \
--output ./backups/Keep the generated compressed database and SHA-256 checksum together. Store copies outside the host or cluster and encrypt them according to transcript sensitivity.
Restore requires downtime because the database must have one writer. The supported helper verifies checksum and integrity, creates a pre-restore backup, scales the writer down, replaces the database, removes stale WAL/SHM files, restores one replica, and checks health.
./deployments/scripts/db-restore.sh \
--env production \
--namespace agent-monitor-production \
--input ./backups/agent-monitor_production_TIMESTAMP.db.gzPractice this in a non-production namespace. Record actual recovery time and verify representative sessions, costs, alert rules, and settings afterward.
npx ccam export ccam-export.json
npx ccam import-data ccam-export.jsonImport is idempotent and non-destructive: existing sessions are skipped rather than overwritten. Use it for portability, not for replacing a corrupted production database.
Define retention from privacy, investigation, capacity, and compliance requirements. Before cleanup:
- measure database and backup growth;
- confirm which records the operation removes;
- create and verify a backup;
- test the same policy on a copy;
- document recovery limits;
- run during a quiet window and verify health.
Do not delete raw provider history until you know whether it is your only recovery source. Avoid unreviewed cron jobs that call broad cleanup or destructive commands.
See the exact deployment backup and restore contract.
Start Here · Localized product Wiki · Repository · Releases · Security · Report an issue
Guidance tracks the current master branch. For a deployed release, consult the repository documentation at that release tag before changing configuration.
CCAM Handbook
Use CCAM
- Read the dashboard
- Sessions and agents
- Kanban and tasks
- Tokens and costs
- Run agents
- Personal settings
Operate CCAM
- Deployment guide
- Hook health
- Security
- Backups and retention
- Prometheus and Grafana
- Remote machines
- Upgrades and rollback
- Incident runbooks
Automate and extend
- CLI patterns
- MCP workflows
- Alerts and webhooks
- Dynamic workflows
- Skills and plugins
- Safe config explorer
- Integration patterns
Help