<a id="cloud-replicator-quickstart"></a>

# Replicator Quick Start to Migrate Topic Data on Confluent Cloud

You can use Replicator to copy or move topic data across Confluent Cloud clusters. Replicator
runs in one of three [modes](migrate-topics-on-cloud-clusters.md#replicator-deploy-modes-cloud): as a
connector, as an executable on a virtual machine (VM), or as an executable on
Kubernetes. This quick start uses Replicator as an executable on an Ubuntu VM to
migrate topics between two Confluent Cloud clusters on
[Amazon Web Services (AWS)](https://aws.amazon.com/).

If you migrate clusters from another cloud platform, such as
[Google Cloud](https://console.cloud.google.com/) or
[Microsoft Azure](https://azure.microsoft.com/), the same general procedure
applies.

## Prerequisites

- Two Confluent Cloud clusters on AWS: A source cluster and a destination cluster,
  including the bootstrap server and SASL credentials for each.
- An Ubuntu VM in Amazon EC2.
- The Confluent CLI installed.

## Install Java and Confluent Platform

1. Install Java.
   ```bash
   sudo apt-get install default-jre
   ```
2. Use [APT](https://wiki.debian.org/Apt) to install the full Confluent Platform as described in [Manual Install using Systemd on Ubuntu and Debian](/platform/current/installation/installing_cp/deb-ubuntu.html).

## Configure Replicator properties files

Replicator uses three configuration files: one for the source cluster, one for the
destination cluster, and one for the replication rules.

### Source cluster

`consumer.properties` configures the connection to the source cluster. Replace
`bootstrap.servers` and `sasl.jaas.config` with the values for your source
cluster.

```properties
bootstrap.servers=<source bootstrap server>
ssl.endpoint.identification.algorithm=https
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="<username>" password="<password>";
security.protocol=SASL_SSL
```

### Destination cluster

`producer.properties` configures the connection to the destination cluster.
Replace `bootstrap.servers` and `sasl.jaas.config` with the values for your
destination cluster.

```properties
bootstrap.servers=<destination bootstrap server>
ssl.endpoint.identification.algorithm=https
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="<username>" password="<password>";
security.protocol=SASL_SSL
```

### Replication rules

`replication.properties` defines which topics to replicate and the rename
rules. Replace “Movies” in `topic.whitelist` with the topics you want to
replicate from the source cluster.

```properties
topic.whitelist=Movies

topic.rename.format=${topic}-replica
topic.auto.create=true
topic.timestamp.type=CreateTime

dest.topic.replication.factor=3
```

In the preceding example, `topic.rename.format`, `topic.auto.create`, and
`topic.timestamp.type` are set to their default values, so you can omit them.
Include a property only to override its default.

## Run Replicator

Run the Replicator executable to migrate topics.

```bash
confluent-5.3.0/bin/replicator \
  --consumer.config ./diyrepl/consumer.properties \
  --producer.config ./diyrepl/producer.properties \
  --cluster.id replicator  \
  --replication.config ./diyrepl/replication.properties
```

## Verify topic migration

To verify that Replicator migrated your topic data, use the Confluent CLI to read
records from the source and destination topics, then confirm that new records
produced on the source appear on the destination. Before you begin,
[log in to the Confluent CLI](https://docs.confluent.io/confluent-cli/current/command-reference/confluent_login.html).

### Check current destination topic contents

Read the destination topic to see the data that Replicator replicated from the
source.

1. List the clusters and note the destination cluster ID.
   ```bash
   confluent kafka cluster list
   ```
2. Select the destination cluster.
   ```bash
   confluent kafka cluster use <ID-for-destination-cluster>
   ```
3. Run the consumer to read from your topic on the destination (for example, `Movies-replica`).
   ```bash
   confluent kafka topic consume --from-beginning 'Movies-replica'
   ```

### Check current contents of source topic

Read the source topic to see the original data.

1. Select the source cluster.
   ```bash
   confluent kafka cluster use <ID-for-source-cluster>
   ```
2. Run the consumer to read from your topic on the source (for example, `Movies`).
   ```bash
   confluent kafka topic consume --from-beginning 'Movies'
   ```

### Produce a record to the source topic

To verify ongoing replication, produce a new record on the source topic, then
re-check the destination topic.

```bash
confluent kafka topic produce Movies
```

### Check logs and destination topic

Confirm the new record replicated by checking the Replicator logs and reading the
destination topic again.

1. Check the output of the running Replicator task for logs indicating processing.
2. Select the destination cluster.
   ```bash
   confluent kafka cluster use <ID-for-destination-cluster>
   ```
3. Run the consumer to read from your destination topic again.
   ```bash
   confluent kafka topic consume --from-beginning 'Movies-replica'
   ```

## Cutover to new cluster

Cutover switches your producers and consumers from the source cluster to the
destination cluster. For the full procedure, see
[Cutover clients to new cluster](migrate-topics-on-cloud-clusters.md#cloud-cluster-migrate-cutover).

## Related content

- [Use Replicator to Migrate Topics on Confluent Cloud Clusters](migrate-topics-on-cloud-clusters.md#cloud-migrate-topics)
- [Replicator Deployment Options](migrate-topics-on-cloud-clusters.md#replicator-deploy-modes-cloud)
