Skip to content

Exporting the Current Configuration


Hint - initial service start required

Before you export the configuration, you have to the installed Keycloak version in its service context at least once. This start initializes the runtime environment under $env:ProgramData\SEAL Systems\data\seal-keycloak.


Exporting from Version 15.0.0

The following instructions use $env:ProgramData\SEAL Systems\data\seal-keycloak-export as an example.

  1. Stop the service:

    stop-service seal-keycloak
    
  2. Export the current configuration to the $env:ProgramData\SEAL Systems\data\seal-keycloak-export directory:

    cmd /c "$env:ProgramFiles\SEALSY~1\seal-keycloak\bin\standalone.bat" "-Djboss.socket.binding.port-offset=10000" "-Djboss.server.base.dir=$env:ProgramData\SEALSY~1\data\seal-keycloak" "-Dkeycloak.migration.action=export" "-Dkeycloak.migration.provider=dir" "-Dkeycloak.migration.dir=$env:ProgramData\SEALSY~1\data\seal-keycloak-export"
    
  3. List the exported files:

    Get-ChildItem -Path "$env:ProgramData\SEAL Systems\data\seal-keycloak-export"
    

    The result includes the following files:

    Example - file list

    • master-realm.json
    • master-users-0.json
    • ... (potentially further numbered files, like master-users-1.json)
    • SEAL-realm.json
    • SEAL-users-0.json
    • ... (potentially further numbered files, like SEAL-users-1.json)
  4. Cancel Keycloak:

    Ctrl-C
    
  5. Restart the service:

    start-service seal-keycloak
    

Exporting from Version 21.0.0

The following instructions use $env:ProgramData\SEAL Systems\data\seal-keycloak-export as an example.

  1. Stop the service:

    stop-service seal-keycloak
    
  2. Export the current configuration to the $env:ProgramData\SEAL Systems\data\seal-keycloak-export directory:

    cmd /c "$env:ProgramData\SEALSY~1\data\seal-keycloak\bin\kc.bat" --config-file="$env:ProgramData\SEALSY~1\config\keycloak.conf" export --dir="$env:ProgramData\SEALSY~1\data\seal-keycloak-export"
    
  3. List the exported files:

    Get-ChildItem -Path "$env:ProgramData\SEAL Systems\data\seal-keycloak-export"
    

    The result includes the following files:

    Example - file list

    • master-realm.json
    • master-users-0.json
    • ... (potentially further numbered files, like master-users-1.json)
    • SEAL-realm.json
    • SEAL-users-0.json
    • ... (potentially further numbered files, like SEAL-users-1.json)
  4. Restart the service:

    start-service seal-keycloak
    

Literature

For details on exporting, see the original documentation.


Back to top