Hi Stian,
I understand. And typically this would indeed by what you want. However in our specific case groups are not part of our realm data as such but belong to our run-time data and are managed in exactly the same way as our users, role mappings and
group mappings. But I guess you cannot cater for all needs so it’s ok.
Another, probably related thing, is that with the LDAP group synching (using the user federation group mapper) groups synched from LDAP to Keycloak are never removed from Keycloak. When a group is deleted from LDAP and the sync is done again the
group remains in Keycloak. Not what you want but I guess the issue is that Keycloak cannot make the distinction between a group synched from LDAP versus a group created from Keycloak itself? The LDAP group mapping is set up quite different from the user synching
of course.
cheers
Roles and groups should be exported to the realm export, while role mappings and group mappings should be exported to the user export.