Skip to main content

Module migrate

Module migrate 

Source
Expand description

v2.10 — migration toolchain (export / import). See migrate::run_export and migrate::run_import. v2.10 — migration toolchain: export / import (RFC D1/D2).

Wire format = a RESP command stream of rebuild frames (SET / HSET / RPUSH / SADD / ZADD / PEXPIREAT) — bidirectionally compatible with redis-cli --pipe. Export walks SCAN cursors (per-key point-in-time; SCAN-class consistency). Import pipelines 512 commands per batch with a fsynced progress file for --resume. Every key’s frames start with DEL, so replay REBUILDS the key from scratch — genuinely idempotent for every type (RPUSH would otherwise append on re-import; the round-trip test caught exactly that). No cross-batch atomicity to lose.

Structs§

ImportReport
Import stats.

Functions§

run_export
Run export — walk the keyspace (optionally under prefix) and write rebuild frames to out_path. Returns exported key count.
run_import
Run import — stream src (a RESP command file) into the server, PIPELINE commands per batch. The progress file <src>.progress records the safely-applied byte offset after every batch (fsynced); resume starts there. Idempotent replay.