Reverse engineer your JBoss AS-WildFly configuration to CLI

Exporting your WildFly / JBoss EAP configuration to a CLI script is something you are going to need one day or another. No worries, the project Profile Cloner comes to rescue! (Updated to work with WildFly 26 and Java 11)

I’ve cloned ProfileCloner!

The original  Profile Cloner Project allows to create a clone of your Profile (or part of it) and export it to a CLI script. The project has not been updated in the last years so to make it run with more recent versions of WildFly and JDK it needs some changes in the configuration files.

For this purpose, I have created my own fork of it:

Firstly, clone or download a copy of the project on your local drive:

git clone

Next, move the the profilecloner folder:

cd profilecloner

Then, build the project to generate the profilecloner.jar file:

mvn install

Finally, set your JBOSS_HOME so that the launch script can pickup the jboss-cli-client.jar:

export JBOSS_HOME=/opt/jboss/

Generating the CLI script from a standalone.xml

We are now ready to reverse engineer the standalone.xml configuration from a WildFly server.
Firstly, start WildFly server:

We will assume that there’s an available management user with credentials (admin/admin). To learn more about User Management check this article: How to Add an User in WildFly

Next, execute the script passing as argument the output script name (save-script.cli) the controller host address (localhost), the user credentials and the profile to clone. You can use the markerplace “profile” to clone the default server profile:
./ -f save-script.cli  --controller=localhost --username=admin --password=admin profile

We are done! Check the save-script.cli to see your XML configuration as a set of CLI batch scripts:

/subsystem="logging"/pattern-formatter="PATTERN":add(pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n")
/subsystem="logging"/pattern-formatter="COLOR-PATTERN":add(pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n")
/subsystem="logging"/periodic-rotating-file-handler="FILE":add(append="true",autoflush="true",file={"relative-to" => "jboss.server.log.dir","path" => "server.log"},name="FILE",named-formatter="PATTERN",suffix=".yyyy-MM-dd")
. . . .

The awesome part of it is that you can create copy of single parts of your profile. For example here is how to reverse engineer the infinispan subsystem you can run:

./ -f save-script.cli  --controller=localhost --username=admin --password=admin /subsystem=infinispan infinispan

Running Profile Cloner in Domain mode

To run Profile Cloner in Domain mode requires you to add the domain profile that you want to clone. For example, if you were to clone the full-ha profile of your Domain configuration you can run:

./ -f save-script.cli  --controller=localhost --username=admin --password=admin /profile=full-ha full-ha

Now your save-script.cli contains all the CLI configuration for your profile:

/profile="full-ha"/subsystem="logging"/pattern-formatter="PATTERN":add(pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n")
/profile="full-ha"/subsystem="logging"/pattern-formatter="COLOR-PATTERN":add(pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n")

Enjoy Profile Cloner!