Overview
Back up your beads database for off-machine recovery. Supports both JSONL exports (portable, git-friendly) and Dolt-native backups (preserves history, faster for large databases).Syntax
Backup Methods
JSONL Export (Default)
Without a subcommand, exports all tables to JSONL files in.beads/backup/:
issues.jsonl- All issuesevents.jsonl- Issue events (incremental)comments.jsonl- Commentsdependencies.jsonl- Dependency relationshipslabels.jsonl- Label associationsconfig.jsonl- Configuration valuesstate.json- Backup metadata
Dolt-Native Backup (Recommended)
For Dolt backends, use Dolt remotes for full history preservation:- Preserves full commit history
- Faster for large databases
- Native Dolt replication
- Branch and tag support
Subcommands
init
Set up a backup destination:- Filesystem:
file:///path/to/backup - DoltHub:
https://doltremoteapi.dolthub.com/user/repo - SSH:
ssh://user@host/path/to/repo
sync
Push to configured backup destination:bd backup init.
status
Show backup status (JSONL + Dolt):- Last JSONL backup timestamp
- JSONL backup counts
- Dolt backup configuration
- Database size
- Auto-backup settings
restore
Restore from JSONL backup files:.beads/backup/ or specified path.
Auto-Backup Configuration
Configure automatic backups viaconfig.yaml:
enabled: Defaults totrueif git remote existsgit-push: Defaults totrueif git remote exists
Flags
| Flag | Description |
|---|---|
--force | Export even if nothing changed |
--json | Output JSON format |
Examples
Manual JSONL Backup
View Backup Status
Setup DoltHub Backup
Setup Filesystem Backup
Restore from Backup
From JSONL:Auto-Backup Configuration
Enable auto-backup:Force Backup (Testing)
Backup Strategies
Local Development
JSONL backups are sufficient:Team Collaboration
Use Dolt remote for shared backup:Production/Critical Data
Multiple backup methods:Disaster Recovery
Regular offsite backups:JSONL Format
Backup files use newline-delimited JSON (JSONL):- Human-readable
- Git-friendly (line-based diffs)
- Portable across backends
- Easy to inspect/edit
Incremental Backups
Events are backed up incrementally:- First backup: Exports all events
- Subsequent backups: Only new events since last backup
- High-water mark tracked in
state.json
Troubleshooting
”No changes to export”
Cause: Database unchanged since last backup Solution: Use--force flag to export anyway:
“Remote not configured”
Cause: No backup remote set up Solution: Initialize backup destination:“Authentication failed” (DoltHub)
Cause: Missing or invalid credentials Solution: Set environment variables:“Restore failed: corrupt JSONL”
Cause: JSONL file contains invalid JSON Solution:- Check file for syntax errors
- Use last known good backup
- Or restore from Dolt remote instead
”Backup directory not found”
Cause:.beads/backup/ doesn’t exist
Solution: Run first backup to create directory:
Related Commands
bd dolt- Direct Dolt operations (push, pull)bd compact- Reduce database size before backupbd doctor- Verify backup integrity