p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
389 stars 66 forks source link

A way to export/import organization settings #50

Closed rvmourik closed 1 year ago

rvmourik commented 1 year ago

Hi,

I might be wrong, but if I were to export the realm/client settings with keycloak cli it doesn't export information regarding the organization that are present, right?

Reason why I am asking is that for our development environment I would like to create an import file which imports realm/client/organization for development purposes on starting the docker containers. This way every developer has the same settings regarding organizations.

Is this something that is possible?

Regards,

Robbert

xgp commented 1 year ago

That's correct. We weren't able to figure out a way to hook into the realm import/export functionality.

Right now, our recommendation is to back up all of the Organization tables in the database and use the dump file to restore. Because we use realm name as our foreign key, there shouldn't be a problem if the UUIDs in the Keycloak tables are different.