RealmDeployDocs
Migration

Moving from another Keycloak host

Move realms from Cloud-IAM, Skycloak, Phase Two or another Keycloak host. With a full export, users keep their passwords.

It is Keycloak to Keycloak, so the move is the same as from your own Keycloak, with one question first: can you get a full export with users?

Get a full export

A full export is made with Keycloak's own export command and holds users with their password hashes, client secrets and realm keys. The admin console's Partial export is not enough: it leaves users out and masks secrets with *.

  • Cloud-IAM documents an export in its console (select the deployment, Pilot → Exports → New export) and through its API, which can encrypt the export with your GPG key. You get a zip with a realm file (<realm>-realm.json) and users files (<realm>-users-<n>.json). Exports are kept for 7 days.
  • Skycloak, Phase Two and other hosts: we found no export documented on their public pages. Ask their support for an export made with kc.sh export, with users.

Check the Keycloak version of the export: it must be the same as ours or older, because Keycloak imports exports from older versions but not from newer ones. See Keycloak versions.

With a full export

Users keep their passwords and TOTP credentials, clients keep their secrets, and the realm keys move, so tokens keep validating if your hostname stays the same. Follow the steps in Moving from a self-hosted Keycloak, from the dry run on.

If the export comes as a realm file and users files, import the realm file first (Create realm → Resource file), then each users file with Realm settings → Action → Partial import.

Without a full export

  1. Export the realm with Partial export, including clients and groups. Secrets come out masked, so rotate every client secret and identity provider secret after the import.
  2. Read users through the admin REST API (GET /admin/realms/<realm>/users, page by page with first and max). The API does not return password hashes.
  3. Import users with the Update Password required action, and send the set-password emails, as described in Importing users yourself.

Before you move

  • The host's own extensions do not come along: clusters run the stock Keycloak image. List every feature your realms use that comes from the host, and replace it with a built-in one.
  • Your hostname: if it is your own domain, point it at your cluster at cut-over (Custom domains and TLS). If it is on the host's domain, the issuer changes, and every app switches to the new one.

The migration page for other hosts covers what each plan includes.

On this page