Export users by CLI in Domain Clustered Mode

Latest response

In an RHSSO Domain Clusterd Mode, how can I export users using CLI?
The default command line like this:

bin/standalone.sh -Dkeycloak.migration.action=export -Dkeycloak.migration.provider=dir -Dkeycloak.migration.dir=/tmp/keycloak_export

cannot run correctly because it uses standalone.xml to start server and export users (but standalone.xml doesn't contain correct settings in domain clustered mode)

So if I add



standalone.sh returns a validation error because main element in these files is not \<server> but it is \<domain>.

Ho can I export users in this scenario?



I do not run RHSSO in domain mode, so I am not completely sure about this. However, in the bin folder there is both a standalone.sh file and a domain.sh file. Have you tried this command?

bin/domain.sh -Dkeycloak.migration.action=export -Dkeycloak.migration.provider=dir -Dkeycloak.migration.dir=/tmp/keycloak_export


Yes, I tried it but with no success. domain.sh script doesn't parse "-Dkeycloak.migration.action=export" variable. So, starting command using domain.sh results in a normal server startup without any export.

Ouch! Sorry to be the one to tell you this, but it looks like you are going to have to open a case with Red Hat. I know, I know. I hate dealing with their so-called support group. I know of one case where someone created a ticket to report an error with documentation. The first response back was "Can you upload some logs for that?" The second response was a request for the submitter to create a bugzilla account and report the documentation error that way.

On the other hand, once you get through the first level support, you have about a 60% chance that they can provide some decent support.

As a side note, it seems that RHSSO is not really ready for production. It is designed for developers rather than production use. The lack of documentation and/or a procedure for backup/export of users and configuration data in a domain clustered mode is only one example of its unsuitability for production. I won't rant too much, but lets just say I have had my own problems in standalone and standalone-ha modes.

Sorry I couldn't help more. Frank