Backup & Restore Keycloak Easy Way

Finding solution this morning and figure out this can be pretty handy.

  1. 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

     

  2. 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

 

dicksonkho

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.