Skip to main content

Backup & Restore

Overview

crocbot stores configuration and state in persistent storage. This guide covers backup procedures for Docker deployments.

What Gets Backed Up

Backup Methods

Export configuration via the setup wizard endpoint:
This creates a portable backup that can be imported on any crocbot instance.

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

  1. Deploy a fresh crocbot instance
  2. Visit https://your-domain.com/setup
  3. 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

Disaster Recovery

  1. Provision new instance
  2. Deploy crocbot following Deployment guide
  3. Restore config via setup wizard or volume restore
  4. Verify channels are connected (Telegram, etc.)
  5. Test by sending a message

Troubleshooting

Export endpoint returns 401

The /setup/export endpoint may require authentication:
  • Set SETUP_PASSWORD environment variable
  • Include password in request headers

Volume backup permission denied

Run backup commands with sudo or ensure Docker socket access.

Restore fails with “volume in use”

Stop all containers using the volume before restore: