Goal: rotate an Ethereum private key without losing data, create an immutable Swarm backup, and restore it into a fresh SwarmKeyDb instance.
printf '%s\n' <old-64-char-hex-private-key> > /tmp/old.key
printf '%s\n' <new-64-char-hex-private-key> > /tmp/new.key
skdb rotate-key --old-key /tmp/old.key --new-key /tmp/new.key
The command reads every key with the old key, re-encrypts it with the new key, and prints a swarm:// rotation manifest reference.
skdb --key /tmp/new.key backup --out /tmp/swarmkeydb-backup.ref
cat /tmp/swarmkeydb-backup.ref
Backups return a single immutable swarm://... URI. When encryption is enabled, the backup payload is protected with the same Ethereum-derived key so the snapshot can be stored off-band.
Point skdb at a new data directory/home and restore with the matching key:
skdb restore --ref "$(cat /tmp/swarmkeydb-backup.ref)" --key /tmp/new.key
skdb --key /tmp/new.key get your:key
The Redis SDKs expose matching management helpers:
backup(), restore(ref, key), rotateKey(oldKey, newKey)backup(), restore(ref, key), rotate_key(old_key, new_key)Backup(ctx), Restore(ctx, ref, key), RotateKey(ctx, oldKey, newKey)These helpers forward to the SwarmKeyDb management commands exposed by the server.