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

# Bring Your Own Kubernetes (BYOK8s) Upgrade

noindex: true

[Contact the Anaconda implementation team](https://anaconda.zendesk.com/hc/en-us/requests/new) before you begin for assistance upgrading your version of Data Science & AI Workbench. It is intended for you to follow along with these instructions as an Anaconda Implementation team member guides you through the upgrade process. They will provide you with a Helm Chart archive that contains all the necessary components needed for upgrading.

<Warning>
  * Current versions of Workbench no longer support Postgres versions 9.6 and older. To align with these changes, you must update your Postgres to a supported version. [Verify your Postgres version is compatible before you begin your upgrade](/docs/data-science/5.8.1/admin/advanced/postgres-upgrade).
  * It is important to [stop all sessions](/docs/data-science/5.8.1/admin/session-mgmt#stopping-sessions) prior to upgrading. If you do not, sessions that are terminated as part of the upgrade process must be restarted manually post upgrade.
  * Sessions can also be stopped programmatically using `ae5-tools` by running the following command in a terminal that has access to your Workbench cluster over the network:

    ```sh theme={null}
    ae5 session list --columns=id --no-header | xargs -n1 ae5 session stop --yes
    ```
</Warning>

## Prerequisites

* You must have access to the [Administrative Server](/docs/data-science/5.8.1/environment-prep/byok8s-prep#administration-server).
* You must verify the Service Account used for the upgrade has the [correct permissions](/docs/data-science/5.8.1/environment-prep/byok8s-prep#namespace-service-account-rbac).
* Air-gapped servers must have the Docker images added to their Docker image repository.

## Upgrading

Upgrade your BYOK8s cluster by performing the following steps:

1. Log in to the service account on the Administrative Server running your Workbench software.

2. [Create a backup of your cluster configurations](./backup-restore#run-the-backup-script).

3. Unpack the Helm Charts provided by Anaconda onto the Administrative Server:

   ```sh theme={null}
   # Replace <HELM_CHARTS> with the Helm Charts you received from Anaconda
   tar xvzf <HELM_CHARTS>
   ```

4. Save your current configurations with the `extract_config.sh` script delivered with your Helm Chart by running the following command:

   ```sh theme={null}
   # Replace <NAMESPACE> with the namespace Workbench is installed in
   NAMESPACE=<NAMESPACE> ./extract_config.sh
   ```

   The `extract_config.sh` script creates a file called `helm_values.yaml` and saves it in the directory where the script was run.

5. Verify the information captured in `helm_values.yaml` file is correct and contains all of your current cluster configuration settings.

6. Begin the upgrade by running the following command:

   ```sh theme={null}
   helm upgrade --values ./helm_values.yaml anaconda-enterprise ./Anaconda-Enterprise/
   ```

   If the upgrade is successful, your output will look like this:

   ```
   Release "anaconda-enterprise" has been upgraded. Happy Helming!
   NAME: anaconda-enterprise
   LAST DEPLOYED: Wed Dec  7 21:52:34 2022
   NAMESPACE: <YOUR_NAMESPACE>
   STATUS: deployed
   REVISION: 10
   TEST SUITE: None
   ```

   The duration of the upgrade depends on both the cluster node count and the speed of the new docker images loading into each node.

## Verifying your upgrade

1. Verify all pods are running by running the following command:

   ```sh theme={null}
   sudo kubectl get pods
   ```
2. Open a web browser and navigate to your Authentication Center.

   ```sh theme={null}
   # Replace <FQDN> with the fully qualified domain name of your Workbench server
   https://<FQDN>/auth/admin
   ```
3. Select **Users** from the left-hand navigation, then click **View all users** and verify your users’ data is present.
4. Open a new tab in your web browser and navigate to your Workbench URL. Log in using the same credentials you used for your previous installation.
5. Review the **Projects** list to verify that all project data has been restored.
6. Verify your deployments have returned to a **started** state.

<Warning>
  If you are upgrading from Workbench version 5.6.2 or older *and* have RStudio installed, *you must* [reinstall RStudio](/docs/data-science/5.8.1/admin/advanced/rstudio-install). This is due to the upgrade of the Workbench base image from UBI8 to UBI9 in version 5.7. UBI9 requires a different binary for RStudio.
</Warning>
