Finding solution this morning and figure out this can be pretty handy.
- Run command below:
./bin/standalone.sh \ -Dkeycloak.migration.action=export \ -Dkeycloak.migration.provider=singleFile \ -Dkeycloak.migration.file=keycloak-backup.json
In my case, i override few parameter as my keycloak is running.
./bin/standalone.sh -P ./standalone/configuration/standalone.properties \ -Djboss.http.port=8090 \ -Djboss.https.port=8098 \ -Djboss.management.http.port=8990 \ -Djboss.management.https.port=8993 \ -Dkeycloak.migration.action=export \ -Dkeycloak.migration.provider=singleFile \ -Dkeycloak.migration.file=keycloak-backup.json
- Once you get the backup file, you can selectively import from your admin console.
source from: https://www.keycloak.org/docs/latest/server_admin/index.html#_export_import
-Djboss.http.port=8090 \
-Djboss.https.port=8098 \
-Djboss.management.http.port=8990 \
-Djboss.management.https.port=8993 \
can be replaced with
-Djboss.socket.binding.port-offset=98
found here: https://stackoverflow.com/a/70363940
Nice approach, very helpful.