[keycloak-user] Preserving IDs while Importing and Exporting

Luis Santos luis at luissantos.pt
Wed Apr 3 13:40:56 EDT 2019


Hi everyone,

I'm currently working on a Keycloak migration/upgrade. We are trying to
export (kc 3.x.x) all our realms and users and import them again into a new
instance(kc 5.0.0).

Unfortunately, the import process generates new uuids and our existing
services break because they rely on the keycloak user ID.

Did anyone come across a similar problem? If yes how did you solve it?

I did some digging and I found a bug (
https://issues.jboss.org/browse/KEYCLOAK-4336) referring to a similar
problem but it was rejected without any details.

I also find the code that overrides the UUID and I'm planning to change it.
Is this approach wrong? I'm not familiar with the code base and maybe these
changes will
lead me to a dead end.

https://github.com/keycloak/keycloak/blob/a516a795a2147128b4c26bafaba95a8477614aab/services/src/main/java/org/keycloak/partialimport/UsersPartialImport.java#L113

I would be grateful if someone could send in the right direction.

Kind regards / Mit freundlichen Grüßen
Luis Santos


More information about the keycloak-user mailing list