> ## 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.

# Upgrading Postgres version

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. To simplify this process, Anaconda provides a script that automates the update, minimizing downtime and ensuring a smooth transition. See which Postgres versions are compatible with your version of Workbench in the latest [release notes](https://anaconda.com/docs/data-science/latest/reference/release.md).

## Checking your Postgres version

You can check your current version of Postgres by running the following command in your cluster:

> [tab] BYOK8s
>
> ```sh theme={null}
>  # Replace <NAMESPACE> with your namespace (default is anaconda-enterprise)
>  kubectl exec -it anaconda-enterprise-postgres-0 -n <NAMESPACE> -- psql --version
> ```

> [tab] Gravity
>
> ```sh theme={null}
>  kubectl exec -it anaconda-enterprise-postgres-0 -- psql --version
> ```

## Upgrading Postgres

You must place a compatible version of Postgres in the same registry as the current Postgres image prior to performing the upgrade.

> [!WARNING]
>
> If you are upgrading your Workbench version, complete that process first, then return here.

1. [Create a backup of your cluster](https://anaconda.com/docs/data-science/latest/install/migrate/backup-restore.md#run-the-backup-script).
2. Pause your instance of Workbench by running the following command:

   ```
   ae_pause.sh
   ```
3. Use the restore script to update your version of Postgres to a compatible version by running the following command:

   ```sh theme={null}
    # Replace <VERSION> with the new Postgres version image number
    bash ae_restore.sh ae5_config_db_YYYYMMDDHHMM.tar.gz ae5_data_YYYYMMDDHHMM.tar.gz --db-version=<VERSION>
   ```
4. Unpause your instance of Workbench by running the following command:

   ```
   ae_unpause.sh
   ```
