Skip to main content

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/:
Exports:
  • issues.jsonl - All issues
  • events.jsonl - Issue events (incremental)
  • comments.jsonl - Comments
  • dependencies.jsonl - Dependency relationships
  • labels.jsonl - Label associations
  • config.jsonl - Configuration values
  • state.json - Backup metadata
For Dolt backends, use Dolt remotes for full history preservation:
Advantages:
  • Preserves full commit history
  • Faster for large databases
  • Native Dolt replication
  • Branch and tag support

Subcommands

init

Set up a backup destination:
Supports:
  • Filesystem: file:///path/to/backup
  • DoltHub: https://doltremoteapi.dolthub.com/user/repo
  • SSH: ssh://user@host/path/to/repo
DoltHub Example:

sync

Push to configured backup destination:
Pushes current database state to the remote configured with bd backup init.

status

Show backup status (JSONL + Dolt):
Displays:
  • Last JSONL backup timestamp
  • JSONL backup counts
  • Dolt backup configuration
  • Database size
  • Auto-backup settings

restore

Restore from JSONL backup files:
Restores database from JSONL files in .beads/backup/ or specified path.

Auto-Backup Configuration

Configure automatic backups via config.yaml:
Auto-detection:
  • enabled: Defaults to true if git remote exists
  • git-push: Defaults to true if git remote exists

Flags

Examples

Manual JSONL Backup

Output:

View Backup Status

Output:

Setup DoltHub Backup

Setup Filesystem Backup

Restore from Backup

From JSONL:
From Dolt remote:

Auto-Backup Configuration

Enable auto-backup:
Disable git push:
Verify settings:

Force Backup (Testing)

Exports even if no changes since last backup.

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):
Advantages:
  • 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
Other tables are fully exported each time (relatively small).

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:
  • bd dolt - Direct Dolt operations (push, pull)
  • bd compact - Reduce database size before backup
  • bd doctor - Verify backup integrity

See Also