= Migrate Referenced Modules

A migrated configuration may reference and depend on a module that is not installed on the target server.
The tool automatically migrates the referenced modules, and their dependent modules as well.

A module is migrated when it is referenced by:

// conditional list depending of config type
ifeval::["{server-migration-serverConfigurationType}" == "Host"]
* A `security-realm` configuration, as plug-in(s) module
endif::[]

ifeval::["{server-migration-serverConfigurationType}" == "Domain"]
* A `security-realm` configuration, as plug-in(s) module
* A `datasource` subsystem configuration, as datasource driver(s) module
* An `ee` subsystem configuration, as a global module
* A `naming` subsystem configuration, as an Object Factory module
* A `messaging` subsystem configuration, as JMS Bridge module
* A `vault` configuration
* An extension not installed in the target server
endif::[]

ifeval::["{server-migration-serverConfigurationType}" == "Standalone"]
* A `security-realm` configuration, as plug-in(s) module
* A `datasource` subsystem configuration, as datasource driver(s) module
* An `ee` subsystem configuration, as a global module
* A `naming` subsystem configuration, as an Object Factory module
* A `messaging` subsystem configuration, as JMS Bridge module
* A `vault` configuration
* An extension not installed in the target server
endif::[]

The console logs a message noting the module ID for any module that is migrated, for example:

// conditional console depending of config type
ifeval::["{server-migration-serverConfigurationType}" == "Host"]
[source,options="nowrap"]
----
INFO  Module cmtool.security-realms:main migrated.
----
endif::[]

ifeval::["{server-migration-serverConfigurationType}" == "Domain"]
[source,options="nowrap"]
----
INFO  Module cmtool.security-realms:main migrated.
INFO  Module cmtool.datasources:main migrated.
INFO  Module cmtool.ee1:main migrated.
INFO  Module cmtool.ee2:main migrated.
INFO  Module cmtool.naming:main migrated.
----
endif::[]

ifeval::["{server-migration-serverConfigurationType}" == "Standalone"]
[source,options="nowrap"]
----
INFO  Module cmtool.security-realms:main migrated.
INFO  Module cmtool.datasources:main migrated.
INFO  Module cmtool.ee1:main migrated.
INFO  Module cmtool.ee2:main migrated.
INFO  Module cmtool.naming:main migrated.
----
endif::[]


TIP: It is possible to *exclude* the migration of specific modules by specifying the id(s) in the environment property named `modules.excludes`.
