Backup & Restore
Overview
crocbot stores configuration and state in persistent storage. This guide covers backup procedures for Docker deployments.What Gets Backed Up
| Component | Location | Description |
|---|---|---|
| Configuration | /data/crocbot.json | Main config (auth, channels, skills) |
| Credentials | /data/credentials/ | API keys, tokens |
| Identity | /data/identity/ | Agent identity files |
| Memory | /data/memory/ | Agent memory and context |
| Settings | /data/settings/ | User preferences |
Backup Methods
Method 1: Config Export (Recommended)
Export configuration via the setup wizard endpoint:Method 2: Backup Script
Use the included backup script for automated backups:Method 3: Docker Volume Backup
For full state backup including all files:Restore Procedures
Restore from Config Export
- Deploy a fresh crocbot instance
- Visit
https://your-domain.com/setup - Import the config file via the setup wizard
Restore from Volume Backup
Scheduled Backups
Using Cron (Local/VPS)
Add to crontab (crontab -e):
Using GitHub Actions
Create.github/workflows/backup.yml:
Backup Verification
Always verify backups are valid:Retention Policy
| Backup Type | Retention | Notes |
|---|---|---|
| Config export | 30 days | Small, keep more |
| Full volume | 7 days | Large, rotate frequently |
| Pre-upgrade | Until next upgrade | Keep one before each upgrade |
Disaster Recovery
- Provision new instance
- Deploy crocbot following Deployment guide
- Restore config via setup wizard or volume restore
- Verify channels are connected (Telegram, etc.)
- Test by sending a message
Troubleshooting
Export endpoint returns 401
The/setup/export endpoint may require authentication:
- Set
SETUP_PASSWORDenvironment variable - Include password in request headers
Volume backup permission denied
Run backup commands withsudo or ensure Docker socket access.
