mysqlkeycloakquarkusdata-migration

How to set database migration strategy to manual in Keycloak 18


According to the Keycloak Docs - Upgrading section (Upgrading), using --spi-connections-jpa-default-migration-strategy=manual would write all the necessary queries needed for database migration to a SQL file and would exit the server.

I have tried this config as an in-line argument as well as tried adding it in to the keycloak.conf file but still when I start the server it automatically migrates the database and starts up.

Have I missed anything? or is there another way to do this?

Also what's the default location where this SQL file will be available at once it is created?


Solution

  • Take a look at PR https://github.com/keycloak/keycloak/pull/11110

    It is named differently, no "default" provider but "quarkus" is used:

    --spi-connections-jpa-quarkus-migration-strategy=manual"

    it may change in future according to comments.

    Update, because of expected change!!!

    The final spi name is with "legacy" now, refer to https://www.keycloak.org/server/db

    --spi-connections-jpa-legacy-migration-strategy=manual