Skip to main content

Module migration

Module migration 

Source
Expand description

Storage backend migration: redb ↔ Persy.

Provides one-shot batch migration between BEAM’s two storage backends. The translation is format-only: the inner Children data is byte-identical between redb and Persy; only the wrapper struct ([NodeRecord]) differs.

§On-disk formats

redb: TableDefinition<&str, &[u8]> in the beam_nodes_v1 table. Key is the node_id directly; value is postcard(Children) (no wrapper).

Persy: A segment named beam_nodes_v1 containing opaque records. Each record is postcard(NodeRecord { node_id, children }).

§CLI

beam migrate --from <redb|persy> --to <redb|persy> \
    --source <path> --target <path> \
    [--batch-size 1000] [--force] [--dry-run]

See the migration plan for the full design rationale.

Structs§

MigrateOpts
Migration options, typically parsed from CLI arguments.
MigrationRecord
A single graph node record in the canonical migration format.
MigrationReport
Result of a completed migration, returned to the caller for reporting.

Enums§

Backend
Source/target backend selector.
MigrateError
All migration error variants.

Functions§

fjall_key_to_node_id
Decodes a fjall keyspace key back to a node_id string.
persy_to_redb_record
Translates a Persy record payload into a redb (node_id, value_bytes) pair.
redb_to_fjall_key
Encodes a node_id string as a fjall keyspace key.
redb_to_persy_payload
Translates a redb record (node_id + raw value bytes) into a Persy record payload.