How to Clone a Keycloak Realm on the Same Instance
A step-by-step guide to cloning a Keycloak realm on the same server. It offers a practical solution to prevent UUID collisions.
Users attempting to duplicate a Keycloak realm on the same server may encounter UUID collisions. This issue arises because each component retains the same UUID when exported. Manually changing UUIDs can be tedious and prone to errors.
The keycloak-realm-clone tool automates this process, replacing every UUID in the exported JSON with a new one, thus preventing collisions. Users can then import the generated file through the Keycloak interface to create their new realm seamlessly.