Node.js CLI tool solves Keycloak realm cloning UUID conflict on same instance
Cloning a Keycloak realm on the same server instance fails because exported realm files retain original database UUIDs, causing primary key conflicts on re-import. This is a known upstream limitation, tracked as keycloak/keycloak#24770, since Keycloak's exporter was designed for cross-instance migration, not same-instance duplication. Manually replacing hundreds of UUIDs while preserving internal references is error-prone and risks silently breaking authentication flows. A dependency-free Node.js CLI tool called keycloak-realm-clone, available on npm, automates the full UUID remapping process using a single old-to-new translation table. Running the tool via npx generates a new export file with a renamed realm and all object references consistently updated, ready for safe import into the same Keycloak instance.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in