Migrating keys between targets
Keydra reads from one target and writes to the other a batch at a time, so the two servers never have to reach each other and the keyspace is walked rather than held.
How keys move between two targets#
Keydra reads from one target and writes to the other, a batch at a time. The two
servers never have to reach each other — Keydra is frequently the only thing that
can reach both — and the keyspace is walked with SCAN rather than held, so its size is not
a limit.
A migration is a row that outlives the dialog that started it. Progress goes out over the notification hub, so the dialog can be closed and the job carries on; Migrations lists every job, whichever target it came from and whoever started it.
What the counts mean#
- Moved
-
Written to the destination.
- Already there
-
The key existed on the destination and Overwrite keys that already exist was off, so it was left as it was.
- Refused
-
The destination would not accept it.
- Removed from source
-
Only when Remove each key from this server once the other one has it was ticked, and only for keys the destination accepted. That is what turns a copy into a move without risking a key that exists nowhere.
Interrupted migrations#
If Keydra stops while a migration is running, the row is marked interrupted on the next start, with the note Keydra stopped while this was running. What had already been written is written. That sweep is a leader’s job, so two instances do not mark each other’s running migrations.
Migrating keys to another target#
-
You hold
migration:runon both targets. -
Both are up. The destination picker offers only targets you can see that are answering.
-
Open the source target’s Keys page.
-
Start Move keys to another server.
-
Choose the Destination.
-
Choose what to move under Keys to move:
-
the keys ticked in the list,
-
everything matching the current filter,
-
every key on this target, or
-
keys matching a pattern you type — a glob such as
user:*.
-
-
Decide two things:
-
Overwrite keys that already exist — without it, a key already on the destination is left alone and counted as Already there.
-
Remove each key from this server once the other one has it — turns the copy into a move.
-
-
Click Start.
-
Either watch it, or click Leave it running and close the dialog.
Migrations shows the job with its State and Progress, and the tally {migrated} of {scanned} found, then {skipped} already existed, {failed} were refused. A finished job reads done.
Stop halts a running migration; what has moved stays moved.
