We would need to create a simple CLI + filesystem commands to remove a domain installation. Besides the domain.xml and host.xml file which other sensitive file should I remove in order to return to the default domain configuration ?
Thanks!
Well deleting a JBoss EAP 6 / AS 7 (same for WildFly) requires basically that you perform some server cleanup + filesystem cleanup. You cannot define a general purpose CLI script for cleaning up your domain but you have to adapt it to your domain configuration.
I'd start with undeploying all applications which are installed on the domain:
undeploy * --all-relevant-server-groups
Then, I'd stop all servers which need to be removed from the configuration:
/host=master/server-config=server-extra:stop
Next you can remove it from the configuration by issuing:
/host=master/server-config=server-extra:remove
This however does not remove the folders which have been created under your "servers" folder, so you have to use some file system commands in order to cleanup your installation:
rm -fr $JBOSS_HOME/domain/servers/server-extra
Finally, you need to restore your domain.xml and host.xml file from the history:
cp $JBOSS_HOME/domain/configuration/domain_xml_history/domain.initial.xml $JBOSS_HOME/domain/configuration/
cp $JBOSS_HOME/domain/configuration/host_xml_history/host.initial.xml $JBOSS_HOME/domain/configuration/
Hope it helps
Francesco