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

# Amazon EFS Provisioner to EFS CSI

> Migrate Cognigy from the deprecated Amazon EFS external provisioner to the Amazon EFS CSI driver.

As of Cognigy 4.45.0, the support for the [EFS external provisioner](https://github.com/kubernetes-retired/external-storage) is deprecated. Cognigy supports the [Amazon EFS CSI driver](https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html) instead.

## Prerequisites

* Kubernetes 1.21 - 1.24.
* Kubectl utility is installed locally.
* [Helm](https://helm.sh/) v3.8+ is installed on the client host.
* [Amazon EFS CSI driver](https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html) is installed in the kubernetes cluster.
* Cognigy installation must be 4.45 or later.
* Snapshots/Backups of all EFS Persistent Volume Claims/Persistent Volumes (flow modules, functions) are must be ready before the migration starts.

## Migration process

1. Retain the `flow-modules` and `functions` Persistent volumes.

   ```bash theme={null}
   kubectl patch pv <flow-modules-pv-id> -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
   kubectl patch pv <functions-pv-id> -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
   ```

2. Enable the EFS CSI provisioner in the `values.yaml` file.

   ```bash theme={null}
   flowModules:
     persistence:
       aws:
         efs:
           enabled: true
           ## EFS File system ID
           ##
           id: ""
           efs_csi:
             enabled: true
   functions:
     persistence:
       aws:
         efs:
           enabled: true
           ## EFS File system ID
           ##
           id: ""
           efs_csi:
             enabled: true
   ```

   For more details, check the [Helm Chart values.yaml reference](https://github.com/Cognigy/cognigy-ai-helm-chart/blob/main/values.yaml)

3. Disable the currently running efs provisioner in the `values.yaml` file by deleting the following code block.

   ```bash theme={null}
   efs:
     flowModules:
       id: "<flow-module efs id>"
     functions:
       id: "<function efs id>"
   ```

4. Delete the `flow-modules` and `function` [StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/).

   ```bash theme={null}
   kubectl delete sc aws-efs-flow-modules aws-efs-functions
   ```

5. Reapply the helm chart.

   ```bash theme={null}
   helm upgrade --namespace cognigy-ai cognigy-ai oci://cognigy.azurecr.io/helm/cognigy.ai --version HELM_CHART_VERSION --values YOUR_VALUES_FILE.yaml --create-namespace
   ```
