Skip to content
Development documentation
This describes Keydra as it is being built and is not a released version. What it documents can change before a release.

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.

The Migrations page before anything has moved

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#

Prerequisites
  • You hold migration:run on both targets.

  • Both are up. The destination picker offers only targets you can see that are answering.

Procedure
  1. Open the source target’s Keys page.

  2. Start Move keys to another server.

  3. Choose the Destination.

  4. 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:*.

  5. 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.

  6. Click Start.

  7. Either watch it, or click Leave it running and close the dialog.

Verification

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.

Edit this page