After testing keycloak exploratory, I want to setup an installation script. First for local development and later for the test servers. I exported my manually configured realm into a json file (tried UI export and during startup, but seems to be the same except for passwords, like the doc says). But the import of my realm gives me a headache. It seems that a lot of configuration is missing. Like my User Storage Provider. I tried import on startup. This deletes the realm first if it already exists and then imports my realm. Result is a completely naked realm. After that I tried import via admin CLI. Update and partial import. But there are also a lot of configurations missing. Most values are default though, I think.
Commands I used:
./standalone.sh -Djboss.socket.binding.port-offset=100 -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=/vagrant/export.json
With admin CLI:
First created the realm
./kcadm.sh create realms -s realm=myrealm -s enabled=true
./kcadm.sh create partialImport -r myrealm -s ifResourceExists=OVERWRITE -o -f /vagrant/export.json
./kcdadm.sh update realms/myrealm -f /vagrant/export.json
Would be nice to understand the differences of the different approaches. Especially because the import via startup keeps the server running. Is there an advantage?
I used keycloak 9.0.3