Copy realm on same server

Hello,

I have a realm on a server and I have configured this realm to my requirements. Now I want to copy this realm on the same server. I klick on “Export” and a JSON file is created. I change the realm name in the file and remove all ids in the file to not get duplicate key exception and then I Import the file again. It works.

My question:

Is there any easier way to export and import realms on the same server?

Is it ok to manipulate the JSON file manually. Are there any pitfalls? What else do I have to modify in the JSON file to not run into trouble?

Best regards
Tobias

Dear Tobias,

Have you tried user import, is it successful.?
Can you please provide the steps for users import.

Thanks

I did something like that editing the realm file.
Have to replace all the references to the realm name and remove all “ids” tags from the json

User import is possible with server startup not in the UI. See this as reference:
https://www.keycloak.org/docs/latest/server_admin/index.html#_export_import

I do the same and it works ok for me