Expand description
Cross-backend database migration command implementation
Handles migration between SQLite backends (copy with side table migration).
§Architecture
This module uses sqlitegraph’s GraphBackend::snapshot_export() and
snapshot_import() methods for graph data migration. The wrapper only
handles directory creation and returns Magellan-specific metadata.
§Side Tables
GraphBackend does NOT handle Magellan-specific side tables:
code_chunks- Code snippets stored in generation modulefile_metrics,symbol_metrics- Pre-computed metricsexecution_log- Command execution trackingast_nodes- AST hierarchy storagecfg_blocks- Control flow graph data
These must be migrated separately via direct SQL.
Structs§
- Backend
Migration Result - Result of a backend migration operation
- Snapshot
Export Metadata - Snapshot export metadata returned by export_snapshot
- Snapshot
Import Metadata - Snapshot import metadata returned by import_snapshot
Enums§
- Backend
Format - Database backend format
- Migration
Error - Errors that can occur during backend format detection
Functions§
- detect_
backend_ format - Detect the backend format of a database file
- export_
snapshot - Export graph data from a backend to a snapshot directory
- get_
graph_ counts - Get entity and edge counts from a graph backend
- import_
snapshot - Import graph data from a snapshot directory into a backend
- migrate_
side_ tables - Migrate Magellan-specific side tables from source to target database
- run_
migrate_ backend - Run a complete backend migration from source to target database
- verify_
import_ counts - Verify that imported counts match exported counts