website/docs/recovery/database-corruption.md
This runbook helps you recover from database corruption in Beads.
bd commands# Check database integrity
bd doctor
# Check Dolt server health
bd dolt show
Step 1: Stop the Dolt server
bd dolt stop
Step 2: Back up current state
cp -r .beads .beads.backup
Step 3: Preview what doctor would fix
bd doctor --dry-run
Step 4: Rebuild database
bd doctor --fix
Step 5: Verify recovery
bd doctor
bd list
Step 6: Restart the Dolt server
dolt sql-server
bd dolt stop before system shutdownbd doctor periodically to catch issues early