Skip to main content

Prerequisites

  • Kubernetes 1.21 - 1.23.
  • Kubectl utility installed locally on Linux or macOS client host. The following guide does not support Windows client hosts.
  • Helm v3.8+ installed on the client host.
  • Yq installed on the client host.
  • Kubernetes cluster meets general Cognigy prerequisites, including hardware resources.
  • Backup of Cognigy secrets for Kustomize installation (MongoDB and Redis connection strings) exists in the form of Kubernetes manifests.
  • Multi-replica MongoDB Helm Chart is used. Cognigy Helm Chart is incompatible with the single-replica MongoDB (mongo-server) installation. If you have not migrated from single to multi-replica, follow migration guide.
  • Cognigy Kustomize installation must be the same version as Cognigy Helm Chart during migration.
  • Cognigy Kustomize installation must be 4.38 or later.
  • Snapshots/Backups of all PVCs/PVs (MongoDB, Redis-Persistent, flow-modules, flow-functions) are made before the migration starts.

Migration Checklist

There are 2 migration scenarios considered here:
  • Migration inside the existing cluster. Cognigy Helm Chart in the cognigy-ai namespace and MongoDB Helm Chart in the mongodb namespace are installed alongside the existing Kustomize installation. We strongly recommend this scenario as this process significantly simplifies the migration of the existing storage.
  • Migration to a new cluster. Cognigy and MongoDB Helm Charts are installed in a new cluster. This scenario is more complex than the first one. You will either need to ensure that underlying storage for existing PVCs can be reattached to the new cluster or restore the data from snapshots in the new cluster.
Before starting migration, do the following steps:
  • Make sure backups (snapshots) for all PVCs are created in your Cloud Provider, including MongoDB, redis-persistent, flow-modules, and functions.
  • Make sure a backup of Cognigy secrets for Kustomize installation is present.
  • Prepare values_prod.yaml values file for Cognigy Helm Chart as described in the Cognigy Helm Chart repository. Ensure that all adjustments (patches) of the current Kustomize installation done from your side are properly migrated to values_prod.yaml file: ENV variables, resource request/limits, replica counts, etc.
  • Prepare the script from Rename MongoDB Databases section, fill in the required password values in advance.

Preparation for Migration

This section describes the procedure to prepare the migration of Cognigy from Kustomize to Helm. These steps can be performed in advance and without bringing your Cognigy installation down.

Secrets

During migration, Cognigy product will be moved from default to a different namespace. In this document, we consider cognigy-ai as a target namespace, you can replace it with a namespace of your choice, but we strongly recommend using the cognigy-ai namespace. Hence, it is required to migrate the existing secrets to the new namespace and inform Helm release about the migrated secrets. To do so, execute the following steps:
  1. The migration scripts can be found in the cognigy-ai-helm-chart repository. Clone the repository and check out your current Cognigy version:
  2. Place a backup of existing secrets in the secrets folder.
  3. Copy the secrets folder into the kustomize-to-helm-migration-scripts folder
  4. Make sure that all the existing secrets are stored in the secrets folder before running the script.
  5. Execute the script, it will generate new secrets for the Helm installation in the migration-secrets folder:
  6. Apply the secrets into a new cognigy-ai namespace:

Persistent Volumes

This subsection describes the migration of persistent volumes for AWS (EBS and EFS with efs-provisioner) and AZURE (Azure disk and Azure files). If your Cognigy is deployed on a different cloud provider, you need to adapt the migration steps accordingly. This subsection considers the Migration inside the existing cluster scenario. For the Migration to a new cluster scenario, you need to restore the data from snapshots of persistent volumes made in the old cluster. We do not provide any commands for the second case, as this process heavily depends on your cloud provider setup. Refer to your infrastructure data backup and restore processes and your cloud provider’s documentation.
  1. Create snapshots of existing Cognigy PVCs: flow-modules, functions, redis-persistent
  2. To avoid loss of PVs during the migration, set Reclaim Policy to retain for underlying PVs of 3 PVCs mentioned above and note down the corresponding PV names:
  3. Get the PVs IDs and note them down:
  4. (AWS only) Get the IDs of underlying Volumes (EFS files shares) for all 2 PVs mentioned above and note them down. You will need to use these IDs in the following steps:
  5. (AWS only): Set the IDs of flow-modules and functions volumes obtained in the previous step in your values_prod.yaml for Cognigy Helm Chart:
  6. (AWS only): For the Migration inside the existing cluster scenario, add annotations and labels to existing flow-modules and functions storage classes and related role bindings:
  7. Save backups of PVC manifests for Kustomize and Helm installations:
  8. Create another copy of PVC manifests, which will be modified in the next step:
  9. Remove unnecessary fields from PVC:
  10. Edit PVC manifests saved in Step 8 for all 3 PVCs in the following way:
  11. Change metadata.namespace to cognigy-ai.
  12. Add meta.helm.sh/release-name: cognigy-ai and meta.helm.sh/release-namespace: cognigy-ai under metadata.annotations.
  13. Add app.kubernetes.io/managed-by: Helm under metadata.labels.
  14. Change spec.volumeName to the name of the respective PVs from Step 2.

Traefik

If you use the Traefik reverse-proxy shipped with Cognigy installation by default, you need to execute the following commands. You do not need to execute these commands if you use a 3rd-party reverse-proxy:

Migration

This section describes the actual migration of Cognigy from Kustomize to Helm. The migration will require downtime of your Cognigy installation. Plan a maintenance window for at least 2 hours accordingly.

Rename MongoDB Databases

  1. Scale down the current installation:
  1. Rename the databases and create new users. In Cognigy Helm Chart, we have renamed service-analytics-collector-provider database to service-analytics-collector and service-analytics-conversation-collector-provider to service-analytics-conversation. To rename the databases, execute the following script, fill in the password values in advance (see the comments inside the script). Check the root username for MongoDB Helm installation (root or admin) and use that as <root_username> while migrating the databases.
The script below is compatible with the cognigy-mongodb-helm-chart only. If you are using any other MongoDB service (for example, MongoDB Atlas), you need to find compatible commands for your database service to rename the databases.

Migrate Persistent Volumes for Cognigy

  1. Attach PVCs of flow-modules, functions and redis-persistent of Cognigy Helm release to the existing PVs of Kustomize installation:
  2. Deploy the PVCs manifests, which have been modified in Prepare Persistent Volumes section.

Migrate Cognigy from Kustomize to Helm

Perform the following steps for Cognigy migration:
  1. Bring back the deployments of Cognigy Helm Release:
  2. Verify that all deployments are in a ready state:
  3. (Traefik as reverse-proxy only) In case EXTERNAL-IP for traefik service of type LoadBalancer changes, update the DNS records to point to the new EXTERNAL-IP of traefik Service. If you’re using Traefik Ingress with AWS Classic Load Balancer, change the CNAME of the DNS entries to the new EXTERNAL-IP. Check the new external IP/CNAME record with:

Rollback

In case Cognigy Helm release does not function properly, and rollback is required, perform the following steps:
  1. Scale down the Cognigy Helm Release deployments
  2. Delete PVCs for Helm Release:
  3. Restore PVCs for Kustomize installation:
  4. Bring back Kustomize installation:
  5. After Cognigy Kustomize installation is up and running, you can clean up the Helm release by completely removing cognigy-ai namespace (the namespace of Helm release):

Clean-up

After Cognigy Helm release is up and running properly, you can clean up the Kustomize installation, for this execute the following steps:
  1. Drop old databases in MongoDB (set MONGODB_ROOT_USER to root or admin in accordance with values_prod.yaml in MongoDB Helm Chart):
  2. Delete the Kustomize deployments running in the default namespace:
  1. Delete the services in the default namespace:
Be careful while deleting services, do not delete the kubernetes service.
  1. Delete the ingresses in the default namespace:
  1. Delete PVCs from default namespace (if still present):
  1. (Optional) Delete PVC for single replica MongoDB setup in case of single-replica to multi-replica MongoDB migration:
Last modified on September 3, 2026