:toc:
= Standalone Server Migration

== Standalone Configuration Processing Overview

When tasked to migrate standalone server configurations, the JBoss Server Migration Tool migrates the configuration files and related content from the source server to the target server. This migration task is optional.

If you run the migration tool in `interactive` mode, which is the default, you are are prompted to confirm its execution.

[source,options="nowrap"]
----
Migrate the source's standalone server?
yes/no?
----

* If you reply with *yes* or *y*, the standalone server migration proceeds.
* If you reply with *no* or *n*, the standalone server migration is skipped.

If you choose to proceed, the tool starts by migrating the source standalone server's content. Because both the source and target servers use a similar cyphered content repository to store data that is referenced by standalone server configurations, such as deployments and deployment overlays, migration of this data merely consists of finding and copying the content from the source server to the target server.

[source,options="nowrap",subs="attributes"]
----
INFO  [ServerMigrationTask#5] Migrating standalone content found: [22/caa450a9ba3b84eaf5a15b6da418b92ce6c98e/content, 23/b62a37ba8a4830622bfcdb960280577cc6796e/content, 40/8bcb8a4480739d370ebf70fbcabb33c1508c50/content, 88/96c992d1b9866945a5015b72f8d254d3d5c132/content, ea/69fbffdf08b320c09ad1acc7d31deba5a7787b/content, fc/8ec517e0b169fb27b61ff90f04de5dd8ca8d52/content]
INFO  [ServerMigrationTask#6] Resource with path /{server-source-baseDir}/standalone/data/content/22/caa450a9ba3b84eaf5a15b6da418b92ce6c98e/content migrated.
INFO  [ServerMigrationTask#7] Resource with path /{server-source-baseDir}/standalone/data/content/23/b62a37ba8a4830622bfcdb960280577cc6796e/content migrated.
INFO  [ServerMigrationTask#8] Resource with path /{server-source-baseDir}/standalone/data/content/40/8bcb8a4480739d370ebf70fbcabb33c1508c50/content migrated.
INFO  [ServerMigrationTask#9] Resource with path /{server-source-baseDir}/standalone/data/content/88/96c992d1b9866945a5015b72f8d254d3d5c132/content migrated.
INFO  [ServerMigrationTask#10] Resource with path /{server-source-baseDir}/standalone/data/content/ea/69fbffdf08b320c09ad1acc7d31deba5a7787b/content migrated.
INFO  [ServerMigrationTask#11] Resource with path /{server-source-baseDir}/standalone/data/content/fc/8ec517e0b169fb27b61ff90f04de5dd8ca8d52/content migrated.
----

Next, the tool scans the source server for standalone server configurations files and prints the results in the console.

[source,options="nowrap",subs="attributes"]
----
INFO  [ServerMigrationTask#3] Retrieving source's standalone configurations...
INFO  [ServerMigrationTask#3] /{server-source-baseDir}/standalone/configuration/standalone-full-ha.xml
INFO  [ServerMigrationTask#3] /{server-source-baseDir}/standalone/configuration/standalone-full.xml
INFO  [ServerMigrationTask#3] /{server-source-baseDir}/standalone/configuration/standalone-ha.xml
INFO  [ServerMigrationTask#3] /{server-source-baseDir}/standalone/configuration/standalone-osgi.xml
INFO  [ServerMigrationTask#3] /{server-source-baseDir}/standalone/configuration/standalone.xml
----

If you run the migration tool in `non-interactive` mode, the JBoss Server Migration Tool migrates all listed configuration files.

If you run the migration tool in `interactive` mode, which is the default, you are presented with the following prompt.

[source,options="nowrap"]
----
Migrate all configurations?
yes/no?
----

* If you reply *yes*, all listed configuration files are migrated.
* If you reply *no*, you receive a prompt asking to confirm the migration, for each listed configuration file:
+
[source,options="nowrap",subs="attributes"]
----
Migrate configuration /{server-source-baseDir}/standalone/configuration/standalone.xml ?
yes/no? y
----

== Customizing the Migration of the Standalone Configuration

The standalone server migration can be customized by configuring the following environment properties:
|===
| Property Name |Property Description

|`standalone.skip` |If set to `true`, the tool skips the entire standalone server migration.
|`server.source.standalone.serverDir` |Defines an alternative path for the source standalone server directory, which defaults to the source standalone server's base directory.
|`server.source.standalone.configDir` |Defines an alternative path for the source standalone server configuration directory, which defaults to the source standalone server's `configuration` directory.
|`server.source.standalone.configFiles` |Specifies the file names of the source standalone server configurations to be migrated.
|`server.target.standalone.serverDir` |Defines an alternative path for the target standalone server directory, which defaults to the target standalone server’s base directory.
|`server.target.standalone.configDir` |Defines an alternative path for the target standalone server  configuration directory, which defaults to the target's standalone  server's `configuration` directory.
|===

The environment configuration can be customized in one of the following ways:

* You can configure the properties in the tool's `config/environment.properties` file:
+
[source,options="nowrap"]
----
standalone.skip=false
server.source.standalone.serverDir=standalone
server.source.standalone.configDir=configuration
server.source.standalone.configFiles=standalone.xml,standalone-full.xml
server.target.standalone.serverDir=standalone
server.target.standalone.configDir=configuration
----
* You can include the above properties in your own custom properties file, and then pass the file on the command line using the `--environment` argument.
* You can pass the information on the command line using a system property. The environment property names must be prefixed with `jboss.server.migration.`, for example:
+
[source,options="nowrap"]
----
-Djboss.server.migration.server.source.standalone.serverDir="standalone"
----

