This page describes how to upgrade the version of a Memorystore for Valkey
instance. For a list of available versions, see [Supported versions](https://docs.cloud.google.com/memorystore/docs/valkey/supported-versions.md.txt).
For more information about the behavior of an instance during an upgrade
operation, see [Version upgrade behavior](https://docs.cloud.google.com/memorystore/docs/valkey/about-upgrading-version.md.txt#version-upgrade-behavior).

## Upgrade the instance version

> [!IMPORTANT]
> **Important:** You can upgrade the version of an instance to any newer version. For example, you can upgrade from version 7.2 to 9.1. However, after you upgrade the version of an instance, you can't downgrade the instance to an earlier version.

### Console

1. In the Google Cloud console, go to the Memorystore for Valkey page.

   [Memorystore for Valkey](https://console.cloud.google.com/memorystore/valkey/instances)
2. Click the ID of the instance that you want to upgrade.

3. In the **Configurations** section, next to **Valkey version** , click
   **Upgrade**.

4. In the **Upgrade version** dialog, do the following:

   1. Click the **Version** menu.
   2. Select the version to which you want to upgrade your instance.
   3. Click **Update instance**.

### gcloud

To upgrade the version of your instance, use the [`gcloud memorystore instances update`](https://docs.cloud.google.com/sdk/gcloud/reference/memorystore/instances/update.md.txt) command.

```
gcloud memorystore instances update INSTANCE_ID \
--project=PROJECT_ID \
--location=REGION_ID \
--engine-version=ENGINE_VERSION
```

Replace the following:

- <var translate="no">INSTANCE_ID</var>: the ID of your Memorystore for Valkey instance.
- <var translate="no">PROJECT_ID</var>: the project ID or number of the Google Cloud project where the instance is located.
- <var translate="no">REGION_ID</var>: the region where the instance is located.
- <var translate="no">ENGINE_VERSION</var>: the version number of Valkey to which you want to upgrade your instance. Accepted values are `VALKEY_7_2`, `VALKEY_8_0`, `VALKEY_9_0`, and `VALKEY_9_1`.

For example:

```
gcloud memorystore instances update my-instance \
--project=my-project \
--location=us-central1 \
--engine-version=VALKEY_9_1
```