Skip to content

Importing a Peviously Exported Configuration


Hint - initial service start required

Before you import the configuration, you have to the installed Keycloak version in its service context at least once. This start initializes the runtime environment under /opt/seal/data/seal-keycloak.


Importing into Version 15.0.0

The following instructions use /opt/seal/data/seal-keycloak-export as an example.

  1. Stop the service:

    sudo systemctl stop seal-keycloak
    
  2. If you want to reimport the complete configuration, proceed with the next step.

    If you only need to import parts of the old configuration:

    1. Make a backup of the /opt/seal/data/seal-keycloak-export directory.

    2. Delete the unneccessary files from the /opt/seal/data/seal-keycloak-export directory.

  3. Import the old configuration from the /opt/seal/data/seal-keycloak-export directory:

    sudo -u seal /opt/seal/seal-keycloak/bin/standalone.sh -Djboss.socket.binding.port-offset=10000 -Djboss.server.base.dir=/opt/seal/data/seal-keycloak -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=dir -Dkeycloak.migration.dir=/opt/seal/data/seal-keycloak-export -Dkeycloak.migration.strategy=OVERWRITE_EXISTING
    
  4. Cancel Keycloak:

    Ctrl-C
    
  5. Restart the service:

    sudo systemctl start seal-keycloak
    

Importing into Version 21.0.0

The following instructions use /opt/seal/data/seal-keycloak-export as an example.

  1. Stop the service:

    sudo systemctl stop seal-keycloak
    
  2. If you want to reimport the complete configuration, proceed with the next step.

    If you only need to import parts of the old configuration:

    1. Make a backup of the /opt/seal/data/seal-keycloak-export directory.

    2. Delete the unneccessary files from the /opt/seal/data/seal-keycloak-export directory.

  3. Import the old configuration from the /opt/seal/data/seal-keycloak-export directory:

    sudo -u seal /opt/seal/data/seal-keycloak/bin/kc.sh --config-file=/opt/seal/etc/keycloak.conf import --dir=/opt/seal/data/seal-keycloak-export --override=true
    
  4. Restart the service:

    sudo systemctl start seal-keycloak
    

Literature

For details on importing, see the original documentation.


Back to top