Bring Your Own Keycloak Realm to Skycloak Managed Keycloak. Move one Keycloak realm to Skycloak: export it with users so password hashes travel, check the file and version, import it, then repoint the issuer and DNS.
To bring your own Keycloak realm to Skycloak, export it with kc.sh export --users realm_file so the users and their credentials are in the same file, check that file against the Keycloak version of the target cluster, and import it into a Managed Keycloak cluster from the cluster’s realms list. Clients, roles, groups, identity providers and authentication flows carry over in the file, and you then repoint the issuer URL, the redirect URIs and your DNS.
The steps follow Keycloak’s guide to importing and exporting realms and Skycloak’s Realm Export & Import docs.
This guide is for teams who already run Keycloak themselves, know their way around realms, clients and kc.sh, and want a managed cluster without rebuilding their configuration by hand or asking every user to reset a password. We follow one realm file from end to end: what goes into it and what stays behind, how to check it, how the import works on Skycloak, and how to cut over and roll back. To move a whole server at once, see our post on migrating self-hosted Keycloak to Skycloak.
You export the realm with its users into one file (1), check that file for secrets and version problems (2), import it into a Managed Keycloak cluster (3), and then point your DNS and your applications at the new issuer (4).
What does a Keycloak realm export carry, and what does it leave behind?
A realm export is a JSON file in Keycloak’s own format. When you write it with the kc.sh export command, it holds the realm’s configuration and, depending on the --users option, its users too. Skycloak’s documentation lists what a realm file moves: realm settings for login, tokens, sessions and required actions, clients, client scopes and roles, identity providers and their mappers, authentication flows, groups, and every user with their credentials, meaning password hashes, OTP and other stored factors (Skycloak docs, Realm Export & Import).
Some things never go into the file. Keycloak states that “Exported data does not include user and admin events, persisted sessions, workflow state or revoked tokens” (Keycloak, Importing and exporting realms). In practice that means your users sign in again after the move, even though they keep their passwords, and your event history stays on the old server, so export it separately if you need it for audits.
The export from the admin console is a different thing, and you should not use it for this move. Keycloak says that with the console’s partial export, “The users for that realm cannot be exported using this method”, that “all sensitive values like passwords and client secrets will be masked with * symbols”, and that “Realms exported from the Admin Console are not suitable for backups or data transfer between servers” (Keycloak, Importing and exporting realms). Use kc.sh export for a realm you want to bring across. For more on realm exports, see our realm export and import strategy post.
Skycloak’s list of what a realm file moves does not include custom themes or custom extensions (SPIs, the Java provider JARs you add to Keycloak) (Skycloak docs, Realm Export & Import), so plan to bring the theme package and the JARs to the cluster separately, which we cover below.
Step 1: Export the realm with its users in one file
Keycloak recommends stopping all nodes before an export, because “Consistency of an export is not guaranteed unless all Keycloak nodes are stopped prior to running the export” (Keycloak, Importing and exporting realms). For a production realm, that means planning a short window where nobody can change data on the old server, or taking the export from a copy of the database restored for the purpose.
Write the realm and its users to a single file with --users realm_file, which Keycloak describes as “Users will be exported to the same file as the realm settings” (Keycloak, configuring how users are exported). The default, different_files, splits users into separate files of 50 each, which is not what you want when you are uploading one realm file.
# Run on the old server, with the Keycloak nodes stopped
bin/kc.sh export --realm myrealm --file myrealm-realm.json --users realm_file
Keep an eye on size. Keycloak advises that “If your database contains more than 50,000 users, export to a directory and not a single file” (Keycloak, exporting a realm to a file). If your realm is that large, a single realm file is the wrong tool, and the database migration route in our self-hosted migration post is the better fit.
Treat the file as a credential store from this moment on. A kc.sh export writes client secrets, SMTP passwords and LDAP bind passwords in clear text unless you used vault references, and it holds the users’ stored credentials. Keep it encrypted at rest, move it over channels you trust, and delete the working copies once the import is done.
Step 2: Check the file for secrets and version problems
Before you upload anything, run the file through our Keycloak export checker. It reads the export in your browser, without sending it anywhere, and lists findings with the setting and the fix: client secrets, SMTP and LDAP passwords in the file, a missing or weak password policy, brute force detection that is off, deprecated realm fields and other settings that newer Keycloak versions changed. Each secret it finds is one you should plan to rotate after the cutover, because it has now existed in a file outside your old server.
Then compare versions. Skycloak’s import refuses a file from a newer Keycloak than the target: “The target cluster’s Keycloak version must be the same as, or newer than, the version the realm was exported from” (Skycloak docs, Realm Export & Import). Create the target cluster on the same version you run today, or a newer one. If you go newer, read the sections of the Keycloak upgrading guide for every release between the two, since that is where changed defaults and removed settings are listed, and our Keycloak Upgrade Risk Checker can list those breaking changes for a pair of versions.
Step 3: Make sure password hashes will work on the target
Users keep their passwords when the hashes come across and the target Keycloak can verify them. Keycloak has changed its default hashing algorithm twice in recent releases. In 24.0.0, “the default password hashing provider has changed from pbkdf2-sha256 to pbkdf2-sha512” (Keycloak upgrading guide, migrating to 24.0.0, Changes to Password Hashing), and in 25.0.0 Keycloak “opted to a different default hashing algorithm Argon2 for non-FIPS environments” (Keycloak upgrading guide, migrating to 25.0.0, Argon2 password hashing). Moving from an older version to a newer one is therefore normal, and the older hashes are not thrown away: the server administration guide says “If you change the hashing algorithm, password hashes in storage will not change until the user logs in” (Keycloak Server Administration, password policies, HashAlgorithm), and the upgrading guide says that “during a password-based login, the user’s passwords will be re-hashed” with the current algorithm (Keycloak upgrading guide, migrating to 25.0.0, Argon2 password hashing).
The risk is a hash in an algorithm the target cannot read, which usually means a custom password hash provider you added as an extension on the old server. Skycloak checks this before the import runs: “If the realm uses a password-hashing algorithm the target cluster does not support, the import is blocked so users are never locked out” (Skycloak docs, Realm Export & Import). If you hit that block, install the provider on the cluster first (see Step 5), or decide whether those users should reset their passwords instead. Our post on federating or migrating legacy users covers the trade-offs when part of your user base sits in another store.
Step 4: Import the realm into a Managed Keycloak cluster
The import is self-serve in the Skycloak dashboard. Open the cluster you want to import into, go to its realms list, choose Import realm, and upload the file. A plain kc.sh export needs no password; an encrypted Skycloak export asks for the one set when it was exported. The realm name comes from the file, and the import runs in the background and emails you when it finishes (Skycloak docs, Realm Export & Import). Realm import depends on your plan, so check the Plan Requirements section of the docs and the pricing page for which tiers include it.
Before the import runs, Skycloak checks the Keycloak version and the password hash algorithms as described above, and it also stops if a realm with the same name already exists on the cluster, so you delete or rename that realm first. If an import fails partway, Skycloak does not delete what it created or retry by itself; the failure message tells you what to do, which is usually to delete the partial realm and import again (Skycloak docs, Realm Export & Import). If an application later reports that the realm cannot be found, see our realm not found troubleshooting guide.
Migrating onto managed Keycloak
Skycloak imports your existing realms, users and clients in Keycloak's own format, because it runs real upstream Keycloak rather than a fork. You drive the import and our team verifies the first realm before it carries live traffic.
Step 5: Bring custom themes and extensions separately
A realm that points at a custom login theme needs that theme on the cluster too. You upload a theme package on the realm’s Branding page, or upload it to the cluster’s Theme Library and assign it to the realm (Skycloak docs, Branding, Skycloak docs, Theme Library). If you build your theme with Keycloakify, our guide to customizing Keycloak themes with Keycloakify in Skycloak shows the packaging.
Custom extensions are JAR files you upload on the cluster’s Custom Extensions tab, where each JAR is scanned before it can be used (Skycloak docs, Extensions). Install them before you test any flow that uses them. Build the JAR against the Keycloak version of the new cluster, since provider APIs change between releases, and our custom SPI development guide explains how. Custom theme and extension uploads depend on your plan as well, so check the pricing page before you count on them.
Step 6: Cut over the issuer, redirect URIs and DNS
Every token Keycloak issues names its issuer, the realm’s URL, such as https://your-cluster-id.app.skycloak.io/realms/my-realm (Skycloak docs, Quickstart), and every application that validates tokens compares that value. OpenID Connect requires that “The Issuer Identifier for the OpenID Provider (which is typically obtained during Discovery) MUST exactly match the value of the iss (issuer) Claim” (OpenID Connect Core 1.0, section 3.1.3.7, ID Token Validation). The realm name comes across unchanged, so the issuer only changes if the host changes.
You have two ways to handle that:
- Keep your hostname. Add your existing domain, such as
auth.example.com, to the cluster as a custom domain, and change the DNS CNAME when you are ready to switch (Skycloak docs, Domain Management). The issuer stays the same, so applications need no change beyond fresh sign-ins. - Use a new hostname. Update each application’s issuer or discovery URL to the cluster’s address, and add the new host to any redirect URIs, web origins and post-logout redirect URIs that name it.
If your source Keycloak is older than version 17 and your clients call URLs under /auth, either update them or check how the cluster serves that path before you switch (Skycloak docs, Migrating from Keycloak). Each external identity provider holds the Redirect URI you copied into its console when you set it up (Skycloak docs, Identity Providers), so update it there, or tell the partner who runs it, before a hostname change. Our post on dual-run IAM migrations explains how to move applications in waves when you cannot switch them all at once.
How do you validate the import and keep a way back?
Test the realm on the cluster’s own address before you touch DNS. Sign in as a test user with an existing password to confirm the hashes work, sign in through each identity provider, run one client credentials grant for each service account, and walk through any flow that uses a custom authenticator or required action. Compare counts too: the number of clients, roles, groups and users in the admin console should match the old server.
Rolling back is simple as long as you leave the old server alone. The import does not change your self-hosted Keycloak, so until you switch DNS or applications, you can delete the imported realm and try again. After the switch, keep the old server running and unchanged for a while, and roll back by pointing DNS or the applications back to it. Users who changed their password on the new cluster in the meantime would have the old one again, so keep that window short and decide in advance what would make you use it.
Once you are live, take a realm export from Skycloak as your first restore point, if your plan includes realm export (see Plan Requirements). Skycloak encrypts it with a password you choose and keeps the download for 24 hours, so store it where you keep backups. For backups beyond a realm export, see our Keycloak backup and restore guide, and if you want copies outside Skycloak, see how to keep off-site Keycloak backups in your own S3 bucket.
FAQ
Do users have to reset their passwords after a realm import?
No, as long as you export with users and the target cluster supports the hash algorithm in the file. Skycloak’s docs say a realm file carries every user with their password hashes (Skycloak docs, Realm Export & Import), and Keycloak keeps stored hashes until each user’s next password login, when it re-hashes them with the current algorithm (Keycloak upgrading guide, migrating to 25.0.0, Argon2 password hashing). Users do have to sign in again, because sessions are not part of an export.
Can I import a realm from an older Keycloak version?
Yes. The target cluster has to run the same version as the source or a newer one, and Skycloak blocks the import into an older version. Read the upgrading guide for the releases in between before you go newer.
Are client secrets included in a kc.sh realm export?
Yes, unless you replaced them with vault references. That is why you should treat the file as sensitive, check it with the export checker, and rotate those secrets after the cutover.
Can I import a realm export from the admin console?
You should not use one for this move. The admin console’s partial export leaves out users and masks secrets with asterisks, and Keycloak says it is not suitable for moving data between servers.
Next steps
Start by exporting your realm with kc.sh export --users realm_file, then run the file through the Keycloak export checker and fix or note what it finds. When the file is ready, you can import it from your cluster’s realms list yourself, or contact us and we will plan the import and the cutover with you. To see what a fully managed cluster looks like for your realm, read about Managed Keycloak hosting on Skycloak.


