Migrate from Keycloak 21 to Keycloak 24 UnmanagedAttributePolicy Error

Upgrading from Keycloak 21.0.1 to Keycloak 24.0.1 we got this exception error in logs (and the server doesn’t start):

2024-03-13 15:37:23,752 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode                                                  
2024-03-13 15:37:23,752 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) Error details:: java.lang.NullPointerException: Cannot invoke "org.keycloak.representations.userprofi
le.config.UPConfig.setUnmanagedAttributePolicy(org.keycloak.representations.userprofile.config.UPConfig$UnmanagedAttributePolicy)" because "upConfig" is null                                          
        at org.keycloak.migration.migrators.MigrateTo24_0_0.updateUserProfileSettings(MigrateTo24_0_0.java:88)                                                                                         
        at org.keycloak.migration.migrators.MigrateTo24_0_0.migrateRealm(MigrateTo24_0_0.java:62)                                                                                                      
        at org.keycloak.migration.migrators.MigrateTo24_0_0.lambda$migrate$0(MigrateTo24_0_0.java:45)

Error seems related to new unmanagedattributepolicy feature.

This sounds worth a bugreport (and some context about the data previously present in the realm)