Shim hooks (bd-shim marker) delegate to 'bd hook' command which already
handles Dolt backend correctly. Update both doctor check and migration
warning to recognize shim hooks as OK.
Only inline hooks (older style with embedded logic) need the explicit
Dolt backend check in the shell script.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two improvements for Dolt backend users with stale git hooks:
1. Migration warning: When running 'bd migrate --to-dolt', warn if
installed hooks lack the Dolt backend check and suggest reinstalling.
2. Doctor check: New CheckGitHooksDoltCompatibility() detects when
hooks exist but lack the Dolt skip logic, surfacing the error with
a clear fix message.
Both changes help users who migrated to Dolt but have pre-migration
hooks that try to run JSONL sync (which fails with Dolt backend).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes from code review:
1. **Data completeness**: Now migrates events (including comments)
and all config values, not just issues/labels/deps
2. **formatJSONArray**: Fixed to use JSON encoding for waiters field
to match Dolt schema (was using comma-separated format)
3. **Cleanup on failure**: Removes partial Dolt directory or SQLite
files if import fails mid-way
4. **Progress indicator**: Shows "Importing issues: N/M" for large
migrations (100+ issues)
5. **Code deduplication**: Extracted common logic into:
- migrationData struct
- storageReader interface
- extractFromStore() shared extraction
- Helper functions for output formatting
6. **Improved dry-run output**: Now shows event count and config
key count in migration plan
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add `bd migrate --to-dolt` and `bd migrate --to-sqlite` commands for
migrating between SQLite and Dolt storage backends.
Features:
- `--to-dolt`: Migrate from SQLite to Dolt backend
- Creates backup of SQLite database before migration
- Imports all issues, labels, and dependencies
- Updates metadata.json to use Dolt backend
- Preserves JSONL export configuration
- `--to-sqlite`: Escape hatch to migrate back to SQLite
- Exports all data from Dolt to new SQLite database
- Updates metadata.json to use SQLite backend
Both commands support:
- `--dry-run` flag to preview changes
- `--yes` flag for automated/scripted usage
- `--json` flag for machine-readable output
- Non-cgo stub for builds without CGO support
This implements Part 7 (Migration Tooling) of DOLT-STORAGE-DESIGN.md.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>