Migration Actions - OndraZizka/jboss-migration GitHub Wiki

EAP 6 specific actions

CliCommandAction

The most used action. It sends a CLI command, or a Management API operation, to the server.
Most of the EAP / AS 7 / WildFly 8+ configuration is managed through the CLI.
Common misconception is to change the configuration/standalone.xml. But that's just a storage for the configuration in DMR and may change at any time - not only in terms of XSD versions (thus also namespaces), but also in terms of overall way to persist. The recommended and forward/backward compatible way to configure EAP is through Management API.

An example of how to create CliCommandAction (this one wil create a datasource):

new CliCommandAction("/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-module-name=org.postgresql.jdbc,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)");

ModuleCreationAction

Creates a new EAP 6 module.
When the module already exists, the ifExists param determines what to do.

Currently, there is no DMR operation for that, but in the future, this might be done through CLI as well - see WFLY-1396.

File oriented actions

CreateDirectoryAction

Creates a directory, if it doesn't exist yet.

CopyAction

Copies a file or a directory tree to other directory.

Parameters: File src, File dest, IfExists ifExists.

If dest is an existing directory, then src is copied to it, keeping original name.
If dest doesn't exist, file or directory is copied under that name; potentially missing parent dirs are created.
When some of the destination files exists, the ifExists param determines what to do.

MergePropertiesFilesAction

Merges properties from the src file into dest properties file.
When the destination file already exists, the ifExists param determines what to do.

XsltAction

Performs a XSLT transformation from src XML file to dest XML file, using xslt file as a template.
The context properties are set for the XSLT engine as variables.
When the destination file already exists, the ifExists param determines what to do.

Special actions

ManualAction

Informs the users that some action has to be done manually.
This happens when:

  • Migration is not possible due to mismatching configuration concepts.
  • Migration is not possible as user has to provide a file or information which is not available.
  • Some functionality was not yet implemented.