.. _delete-topics-c3: ####################################### Delete Topics Using |c3-short| for |cp| ####################################### .. note:: If :ref:`RBAC ` is enabled, you must have permissions to delete a topic. Contact your |rbac| system administrator. You can manually delete topics in the |c3-short| UI or bulk delete internal topics with a script. When you make a delete request for a topic in the UI, the topic is marked for deletion. The topic is not deleted immediately unless it does not contain any data, such as a newly created topic. In addition, you cannot recreate a topic with the same name as the topic marked for deletion until the original topic and its data has finished being deleted. ********************** Delete a single topic ********************** #. Select a cluster from the navigation bar. #. Click the **Topics** cluster submenu. The Topics page appears. #. Click the link for the topic name. The Overview page appears. #. Click the **Configuration** tab. #. Click **Edit settings** -> **Delete topic**. #. Confirm the topic deletion by typing the topic name and click **Continue**. .. _bulk-delete-topics-c3: *************************** Bulk delete internal topics *************************** Upgrading the |c3-short| version or changing the instance ID can result in a large number of outdated internal topics. Manual deletion of these topics can be time consuming, and can result in unexpected behavior if you delete the wrong topics. You can use a cleanup script called ``control-center-cleanup`` to delete topics associated with an older instance of |c3-short|. The script is located in the bin directory under your Confluent home directory: .. code-block:: bash {CONFLUENT_HOME}/bin/control-center-cleanup The following image shows an old set of internal topics prefixed with ``_confluent-controlcenter-6-1-0-1`` and a new set prefixed with ``_confluent-controlcenter-6-2-0-1`` after |c3-short| was upgraded from version from 6.1.0 to 6.2.0. .. figure:: /images/c3-old-new-internal-topics.png :width: 60% :alt: Topics associated with an older and current version of Control Center The script is interactive, and you can delete internal topics with the script while |c3-short| is running. The script reads the properties file and determines the following: - The name of the running instance from the ``confluent.controlcenter.name`` property. - The |c3-short| version running based on the current package where you are running the script. - The instance identifier from the ``confluent.controlcenter.id`` property value. - The directory that contains data for |c3-short| from the ``confluent.controlcenter.data.dir`` property value. To run the cleanup script: #. Make sure |c3-short| version 6.2 or later is up and running. #. Navigate to your Confluent home directory and run the script with the following command, passing the properties file for the current instance: .. code-block:: bash control-center-cleanup etc/confluent-control-center/control-center.properties The script determines the current version and looks for older versions. If you have files for an older version, you will get output similar to the following: .. code-block:: bash The cleanup script found the following instance: _confluent-controlcenter-6-2-0-1 We believe this COULD be the instance defined in your config file so it will not be prompted for cleanup. Here are the instances discovered for cleanup: _confluent-controlcenter-6-1-0-1 Cleanup ALL of the instances above? [y/N]: N #. Type ``y`` to clean up old instances, or type ``N`` to receive prompts to complete the cleanup process for one instance at a time. For example: .. code-block:: bash Do you want to cleanup _confluent-controlcenter-6-1-0-1 ? [y/N/dryRun]: #. Type ``dryRun`` and the script output lists all of the files that will be deleted. You are then prompted to clean up this instance (``y``) or move to the next instance (``N``). For example: .. code-block:: bash Finished dryRun for _confluent-controlcenter-6-1-0-1 . Do you want to clean it up? [y/N/dryRun]: For more information about how to use the cleanup script, see `Removing Residue Data with Control Center Cleanup Script (blog post) `__. .. _delete-topics-internal-c3: ****************************** Delete a single internal topic ****************************** With each version upgrade or ID change, |c3-short| (running in :ref:`Normal mode `) creates a new set of internal topics that correspond to the new |c3-short| instance. These old topics are not used by the new |c3-short| instance, but they continue to take up disk space. You may be directed to delete these topics by `Confluent Support `__ or may need to delete them to clean up disk space. .. caution:: Deleting an internal topic could adversely impact your |cp| installation. If in doubt, consult Confluent Support. The preferred method to delete old internal topics is to use the :ref:`deletion script` provides a safer way to bulk-detect and delete internal topics that are no longer in use. To delete a single internal topic: #. Select a cluster from the navigation bar. #. Click the **Topics** cluster submenu. The All topics page appears. #. Click the **Hide internal topics** toggle to off to unhide internal topics. Internal topics are prefixed with an underscore. .. figure:: /images/c3-topics-show-internal.png :scale: 60% :alt: Show internal topics in Confluent Control Center #. Click the link for the topic name that you want to delete. The Overview page appears. #. Click the **Configuration** tab. #. Click **Edit settings** -> **Delete topic**. You are prompted to type the topic name to confirm deleting the topic. #. Select the check box to acknowledge your awareness that you are deleting an internal topic and its possible ramifications. .. figure:: /images/c3-confirm-internal-delete-topic.png :scale: 60% :alt: Confirm delete internal topic in Confluent Control Center #. Click **Continue**. The topic is marked for deletion. To cancel deleting the topic, click **Cancel**.