[id='sync_data']
= Synchronizing Data to Target Clusters
When your target cluster is running and handling client requests using a remote
cache store to load data on demand, you can synchronize data from the source
cluster to the target cluster.

This operation reads data from the source cluster and writes it to the target
cluster. Data migrates to all nodes in the target cluster in parallel, with
each node receiving a subset of the data. You must perform the synchronization
for each cache in your {brandname} configuration.

.Procedure

. Start the synchronization operation for each cache in your {brandname}
configuration that you want to migrate to the target cluster.
+
Use the {brandname} REST API and invoke `POST` requests with the `?action=sync-
data` parameter. For example, to synchronize data in a cache named "myCache"
from a source cluster to a target cluster, do the following:
+
[source,options="nowrap",subs=attributes+]
----
POST /v2/caches/myCache?action=sync-data
----
+
When the operation completes, {brandname} responds with the total number of
entries copied to the target cluster.
+
Alternatively, you can use JMX by invoking
`synchronizeData(migratorName=hotrod)` on the `RollingUpgradeManager` MBean.
+
. Disconnect each node in the target cluster from the source cluster.
+
For example, to disconnect the "myCache" cache from the source cluster, invoke the following `POST` request:
+
[source,options="nowrap",subs=attributes+]
----
POST /v2/caches/myCache?action=disconnect-source
----
+
To use JMX, invoke `disconnectSource(migratorName=hotrod)` on the `RollingUpgradeManager` MBean.

.Next steps

After you synchronize all data from the source cluster, the rolling upgrade
process is complete. You can now decommission the source cluster.
