<a id="cloud-migrate-kcp"></a>

# Migrate Clusters with the Copy Paste (kcp) Tool

Copy Paste (kcp) is a command-line tool for migrating existing Apache Kafka® cluster
deployments to Confluent Cloud. kcp provides a set of features that help you analyze,
plan, and execute migrations efficiently.

kcp supports migrating from two source types:

- Amazon Web Services (AWS) Managed Streaming for Kafka (MSK), including MSK
  Provisioned/Express and MSK Serverless clusters.
- Kafka: any Kafka API-compatible source, reached directly through the Kafka
  Admin API.

Not every kcp command supports every source type or flavor. For the full list of
which commands work with which source, see the [Source Compatibility matrix](https://confluentinc.github.io/kcp/latest/source-compatibility/) in the kcp
documentation.

To evaluate and plan your migration before you use kcp, you can start in the
[Migration hub](https://confluent.cloud/migration-hub), which you open from
the navigation menu in the Confluent Cloud Console. The Migration hub provides
resources to help you get started, including a step-by-step migration guide and
free help from a migration expert. You must sign in to access this resource.

## What kcp does

The kcp tool streamlines the migration process through these main functions:

- Environment initialization: kcp helps initialize the local environment with
  required configuration variables, helping to simplify running subsequent
  commands.
- Scanning and discovery: kcp scans and identifies resources within your
  existing Kafka deployments. This includes detailed information on clusters,
  brokers, topics, and consumer groups.
- Report generation: kcp creates reports that provide migration planning
  and cost analysis. These reports detail cluster configurations, metrics, and
  other critical information.
- Asset generation: kcp generates the necessary migration assets and
  infrastructure configurations, which can be provisioned using tools like
  Terraform.
- Client migration: kcp migrates client applications to Confluent Cloud using
  Confluent Cloud Gateway (Confluent Gateway), redirecting traffic from the source Kafka cluster
  to Confluent Cloud without requiring changes to client configurations. For more
  information, see [Migrate between Kafka Clusters using Confluent Cloud Gateway](../cp-component/gateway/gateway-migrate.md#gateway-client-switchover).

## Set up kcp

To set up kcp, first determine whether your existing Kafka clusters are reachable
from the internet or only from a private network, because this determines where
you run kcp from.

- **Internet-accessible clusters**: Run kcp commands directly from your local
  computer.
- **Private-network clusters**: Run kcp from a bastion host or jump server in
  the same VPC as your clusters. If you don’t have one, use the
  `create-asset` command described in the [Command Reference](https://confluentinc.github.io/kcp/latest/command-reference/).

Next, install kcp. It’s available for macOS, Linux, and Windows. For
installation instructions, including the recommended install script and manual
download steps for each platform, see [Installation](https://confluentinc.github.io/kcp/latest/#installation) in the kcp
documentation.

Finally, authenticate kcp against your source cluster. For MSK migrations, kcp
authenticates against AWS using the standard AWS credential chain. For Kafka
migrations, kcp authenticates directly against the source cluster’s Kafka Admin
API using an `apache-kafka-credentials.yaml` file. For the full list of
supported AWS authentication methods and file formats, see [Authentication](https://confluentinc.github.io/kcp/latest/#authentication) in the kcp
documentation.

## kcp command reference

The kcp tool is structured around these central commands: `help`,
`discover`, `scan`, `report`, `create-asset`, `migration`, and `ui`.
For full command and flag details, see [Command Reference](https://confluentinc.github.io/kcp/latest/command-reference/) in the kcp
documentation.

- For which `scan` types are available for each source, see the [Source
  Compatibility matrix](https://confluentinc.github.io/kcp/latest/source-compatibility/).
- For a full `migration` walkthrough, see [Getting started with zero-cut
  migrations](https://confluentinc.github.io/kcp/latest/getting-started-with-zero-cut-migrations)
  in the kcp documentation.

## Related content

- [Migrate to Confluent Cloud](migrate-to-confluent-cloud.md#cloud-migrate-to-cc)
- [Migrate data with Cluster Linking on Confluent Cloud](../multi-cloud/cluster-linking/migrate-cc.md#cluster-linking-migrate-cc)
- [kcp Releases](https://github.com/confluentinc/kcp/releases)
- [kcp README](https://github.com/confluentinc/kcp?tab=readme-ov-file#overview)
- [kcp Source Compatibility matrix](https://confluentinc.github.io/kcp/latest/source-compatibility/)
- [Quick Start for Confluent Cloud](../get-started/index.md#cloud-quickstart)
- [Use Replicator to Migrate Topics on Confluent Cloud Clusters](migrate-topics-on-cloud-clusters.md#cloud-migrate-topics)
