<a id="migrate-ak-cc"></a>

# Migrate from Kafka to Confluent Platform

To migrate from Apache Kafka® to Confluent Platform, install Confluent Platform on each node alongside
Kafka, copy your Kafka configuration files into the Confluent Platform directory, then
switch services from the Kafka directory to the Confluent Platform directory one node
at a time. Migrate brokers first, then KRaft controllers.

Confluent Server requires that the `confluent.license` property be set to a valid
license string in each broker properties file. Each broker checks the
license at start up. For more information, see [Manage Confluent Platform Licenses](license.md#cp-license-overview).

<a id="migrate-kafka"></a>

## Migrate an Existing Kafka Deployment to Confluent Platform

To migrate from open source Kafka to Confluent Platform, start by assessing your
current Kafka deployment. Identify the Kafka version, the Kafka
components in use, and your configuration file locations.

#### IMPORTANT
You should not move from Kafka to Confluent Platform while also doing a migration from ZooKeeper to KRaft mode. For
example, if you are using Kafka 3.8 in ZooKeeper mode, you should:

1. Perform a rolling migration from Kafka 3.8 to Confluent Platform 7.8 in ZooKeeper mode.
2. Migrate from ZooKeeper to KRaft mode with Confluent Platform 7.8. For more information, see [Migrate from ZooKeeper to KRaft on Confluent Platform](migrate-zk-kraft.md#migrate-zk-kraft).

The version of Kafka in Confluent Platform is fully compatible with
the matching open source version and only contains additional patches for
critical bugs when Confluent Platform and Kafka release schedules do
not align.
For version compatibility, see [Confluent Platform and Apache Kafka compatibility](versions-interoperability.md#cp-ak-compatibility). You should migrate to a compatible
version, and if you want to upgrade, do so after you migrate.
Migrate all cluster controllers before you migrate the brokers.

An existing cluster can typically be upgraded by
performing a [rolling restart](../kafka/post-deployment.md#rolling-restart) of Kafka nodes.

### Step 1: Download the Confluent Platform packages

Download and install the Confluent Platform archive that contains the entire platform. The next steps
describe downloading a TAR or ZIP archive. For all of the installation options, see [Install Confluent Platform On-Premises](overview.md#installation).

1. Download the correct version of the Confluent Platform TAR or ZIP archive from [https://www.confluent.io/download/](https://www.confluent.io/download/#confluent-platform).
2. Extract the contents of the archive into a new Confluent Platform install directory. For ZIP files, use a GUI to extract the contents or run this command in a terminal:
   ```bash
   unzip confluent-8.3.1.zip
   ```

   For TAR files run this command:
   ```bash
   tar xzf confluent-8.3.1.tar.gz
   ```

### Step 2: Migrate the brokers

You should migrate your Kafka brokers before you migrate your KRaft controllers.

1. Copy all of the configuration files from the Kafka  `./config` directory into the same location in the  `./etc/` folder under the new Confluent Platform
   directory. For KRaft mode, broker configuration files are located in the `/config/kafka/` directory and should be copied to the `etc/kafka/` directory.
2. Stop all Kafka services running in the Kafka directory. For example, this could include `kafka-server`.
3. Start the corresponding services in the Confluent Platform directory, and in addition start any Confluent enterprise services you want to
   use, for example `confluent-control-center`. Similar to Kafka, the start and stop scripts for all services are found in the `./bin` directory.
4. Repeat these steps on each server, one server at a time, to perform rolling migration.
5. If at any time you want to move back to Kafka, stop the services in the Confluent Platform installation directory and start them in the Kafka directory.

### Step 3: Migrate the KRaft controllers

For Kafka running in KRaft mode, you migrate your controllers and other services after you migrate your brokers.

1. Copy the `controller.property` files from the Kafka `./config/` directory into the `./etc/kafka/` folder under the new Confluent Platform
   new installation directory.
2. Stop the KRaft controllers (`kafka-server`) in the Kafka directory.
3. Start the controllers in the Confluent Platform directory.
4. Repeat these steps on each controller, one controller at a time, to perform rolling migration.

   #### NOTE
   If you are migrating from an Kafka version 3.8.1 or earlier, perform a rolling restart of your
   brokers after the controller migration is complete. This ensures the broker registration with the new Confluent Platform controllers is
   up to date and that the brokers are using the latest possible `confluent.metadata.version`.
5. If at any time you want to move back to Kafka, stop the controllers in the Confluent Platform installation directory and start them in the Kafka directory.

### Step 4: Optionally add additional tools and features

Remaining Confluent Platform services can be added incrementally.
For example, start by adding Schema Registry and updating your applications to use the Avro
serializer.
You can also add the REST Proxy to support applications that
might not have access to good Kafka clients or Avro libraries. Run the HDFS
connector to load data from Kafka into HDFS continuously.

For an overview of all the features that Confluent Platform provides, see [Confluent Platform features](../get-started/platform.md#cp-features).

<a id="enterprise-migration"></a>

#### Related content

- [Migrate Confluent Platform to Confluent Server](migrate-confluent-server.md#migrate-confluent-server)
- [Manage Confluent Platform Licenses](license.md#cp-license-overview)
