Using WildFly CLI to read the configuration file

If you want to read the application server configuration file (e.g. standalone.xml or domain.xml) directly from the CLI all you need to do is executing the command :read-config-as-xml. This can be useful to be executed as part of a script, so that you can redirect the standard output to a file, like in the following example:

./jboss-cli.sh -c --controller=localhost:9990 --user=admin --password=Password1! --command=":read-config-as-xml()" > myconfig.xml

On the other hand, if you want to reverse engineer the application server’s configuration, then we recommend using the Profile cloner tool, which is discussed in this tutorial: Reverse engineer your JBoss AS-WildFly configuration to CLI


Recommended Articles

WildFly CLI: How to Read System Properties Using Platform MBeans

Learn how to gather WildFly system properties using the Platform MBeans and the WildFly CLI.

WildFly Non-Interactive CLI Commands Tutorial

Learn how to run WildFly CLI commands non-interactively using files or shell prompts. Includes echo command for testing.

Using WildFly CLI Property Files for Variables - A Comprehensive Guide

Learn how to define and manage variables using a property file with WildFly CLI scripts. #WildFlyCLI #Java #CloudNative

Master WildFly CLI Execution with JCliff: A Powerful Tool for Efficient Management

Learn how to leverage JCliff to streamline WildFly application server management using the Command-Line Interface (CLI). Discover how to simplify complex tasks, update existing objects, and more.