> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamnative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade from Pulsar Operators

StreamNative Operator includes controllers for `ZooKeeperCluster`, `BookKeeperCluster`, `PulsarBroker`, `PulsarProxy` CRDs so it can be smoothly to replace the Pulsar Operators and take over the existing provisioned Pulsar cluster.

This document demonstrates how to upgrade to StreamNative Operator from Pulsar Operators.

<Tabs>
  <Tab title="Helm">
    To upgrade to `sn-operator` under the Helm installation, follow below steps.

    * Uninstall the `pulsar-operators` chart release

    ```
    helm uninstall pulsar-operator -n sn-system
    ```

    <Note title="Note">
      Do not clean up the `ZooKeeperCluster`, `BookKeeperCluster`, `PulsarBroker`, `PulsarProxy` CRDs after uninstalling the `pulsar-operators` pods, removing CRDs will trigger to delete the existing provisioned Pulsar cluster.
    </Note>

    * Import license through

    ```
    cat <<EOF | kubectl apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
    # This label is a required field for the sn-operator to detect the license.
      labels:
        cloud.streamnative.io/type: "license"
      name: sn-license
      namespace: sn-system
    type: Opaque
    stringData:
      license: "Your license token"
    EOF
    ```

    If you do not have any license, you can contact StreamNative to apply for a [free trial](https://streamnative.io/deployment/start-free-trial).

    * Apply the StreamNative Operator CRDs

    ```
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/bookkeeper.streamnative.io_bookkeeperclusters.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_agentfunctions.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_apikeys.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_connections.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_connectorcatalogs.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_consoles.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_coordinators.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_kafkaclusters.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_kafkaconnects.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_kafkarestproxies.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_mqttproxies.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_oxiaclusters.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_oxianamespaces.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_pfsqlclusters.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_pulsarcoordinators.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_snschemaregistries.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_storagecatalogs.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_unilinks.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/k8s.streamnative.io_unilinkschemas.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/pulsar.streamnative.io_pulsarbrokerrevisions.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/pulsar.streamnative.io_pulsarbrokers.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/pulsar.streamnative.io_pulsarfunctionsworkers.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/pulsar.streamnative.io_pulsarproxies.yaml --server-side --force-conflicts
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/refs/heads/branch-0.17.0/charts/sn-operator/crds/zookeeper.streamnative.io_zookeeperclusters.yaml --server-side --force-conflicts
    ```

    * Install the StreamNative Operator through Helm

    ```
    helm install sn-operator streamnative/sn-operator -n sn-system
    ```

    After the `sn-operator` pod get into running, `sn-operator` will take over the existing Pulsar cluster.
  </Tab>

  <Tab title="OLM">
    To upgrade to `sn-operator` under the Helm installation, follow below steps.

    * Delete `pulsar-operators` related `Subscription`:

    ```
    kubectl delete subscription zookeeper-operator -n operators
    kubectl delete subscription bookkeeper-operator -n operators
    kubectl delete subscription pulsar-operator -n operators
    ```

    * Delete `pulsar-operators` related `ClusterServiceVersion`:

    ```
    kubectl delete csv bookkeeper-operator.v0.17.10 -n operators
    kubectl delete csv pulsar-operator.v0.17.10 -n operators
    kubectl delete csv zookeeper-operator.v0.17.10 -n operators
    ```

    <Note title="Note">
      Do not clean up the `ZooKeeperCluster`, `BookKeeperCluster`, `PulsarBroker`, `PulsarProxy` CRDs after uninstalling the `pulsar-operators` pods, removing CRDs will trigger to delete the existing provisioned Pulsar cluster.
    </Note>

    * Import license through

    ```
    cat <<EOF | kubectl apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
    # This label is a required field for the sn-operator to detect the license.
      labels:
        cloud.streamnative.io/type: "license"
      name: sn-license
      namespace: sn-system
    type: Opaque
    stringData:
      license: "Your license token"
    EOF
    ```

    If you do not have any license, you can contact StreamNative to apply for a [free trial](https://streamnative.io/deployment/start-free-trial).

    * Install the StreamNative Operator through OLM

    ```
    kubectl apply -f https://raw.githubusercontent.com/streamnative/private-cloud/main/quick-start/olm-subscriptions.yaml
    ```

    After the `sn-operator` pod get into running, `sn-operator` will take over the existing Pulsar cluster.
  </Tab>
</Tabs>
