Upgrade from Aiven for Caching to Aiven for Valkey™
Upgrade your Aiven for Caching service to Aiven for Valkey using the Aiven Console or Aiven API. The process retains configurations, users, and data without disrupting your service.
Prerequisites
- Ensure your Aiven for Caching service is running version 7.2. Upgrade to 7.2 if needed.
- To upgrade using the Aiven API, ensure you have an Aiven API token with the necessary permissions.
- To upgrade using the Aiven Operator for Kubernetes®, ensure your version is 0.15.0 or later and you have an Aiven API token with the necessary permissions.
What to expect during the upgrade
- No new service created: The upgrade changes the type of the existing service.
- No service disruption: The upgrade occurs without interruption. The service is recycled, and the nodes are replaced, but your service continues to operate during the process.
- DNS updates: DNS names update to new hosts during the upgrade. This might cause brief delays as the changes take effect, but the service remains available.
- Automatic configuration transfer: All Aiven for Caching configurations are automatically updated to work with Aiven for Valkey. No manual changes are needed.
After you upgrade to Aiven for Valkey, you cannot revert to Aiven for Caching.
Upgrade service
- Aiven Console
- Aiven API
- Aiven Operator for Kubernetes®
- Access the Aiven Console and select your Aiven for Caching service.
- Click Service settings.
- Go to Service management section, and click Actions > Upgrade to Valkey.
- On the confirmation window, review the upgrade process guidelines, and click Confirm upgrade.
After confirming, the Service status changes to Rebalancing in the Service settings screen. This indicates that the upgrade is in progress. The nodes are recycled, and your service continues to operate as the upgrade completes.
-
To upgrade the service to Aiven for Valkey using the API, run:
curl -X PATCH \
-H "Authorization: <AIVEN_TOKEN>" \
-H "Content-Type: application/json" \
--data '{"service_type": "valkey"}' \
https://api.aiven.io/v1/project/PROJECT_NAME/service/SERVICE_NAME/service_typeReplace
AIVEN_TOKEN
,PROJECT_NAME
, andSERVICE_NAME
with your actual values. -
Confirm the upgrade by checking the service details with this command:
curl -X GET \
-H "Authorization: <AIVEN_TOKEN>" \
"https://api.aiven.io/v1/project/PROJECT_NAME/service/SERVICE_NAME"
-
Get authenticated and authorized to use the Aiven Operator for Kubernetes.
-
Add the deletion policy annotation in the Aiven for Redis manifest.
-
In the manifest file of your Aiven for Redis service, for example
redis-service.yaml
, add the deletion policy annotation:controllers.aiven.io/deletion-policy: Orphan
.apiVersion: aiven.io/v1alpha1
kind: Redis
metadata:
annotations:
controllers.aiven.io/deletion-policy: Orphan
name: SERVICE_NAME
spec:
project: PROJECT_NAME
cloudName: CLOUD_AND_REGION_NAME
plan: SERVICE_PLAN_NAME -
Update the service by applying the configuration:
kubectl apply -f redis-service.yaml
-
Verify that the annotation has been applied:
kubectl get redis SERVICE_NAME -o yaml | grep -m 1 Orphan
Expected output:
controllers.aiven.io/deletion-policy: Orphan
-
-
Migrate your Aiven for Redis service in the Aiven API.
Change the service type from
redis
tovalkey
by calling the ServiceServiceTypeUpdate API endpoint, replacingPROJECT_NAME
andSERVICE_NAME
with meaningful values.curl -X PATCH "https://api.aiven.io/v1/project/PROJECT_NAME/service/SERVICE_NAME/service_type" \
-H "Authorization: Bearer $AIVEN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"service_type": "valkey"}' -
Migrate your Aiven for Redis service in Kubernetes:
-
Copy the content of the Aiven for Redis manifest file (
redis-service.yaml
) to a new Aiven for Valkey manifest file (valkey-service.yaml
) with CLI:cp redis-service.yaml valkey-service.yaml
-
Modify the new Aiven for Valkey manifest file (
valkey-service.yaml
):- Replace
kind: Redis
withkind: Valkey
. - Add the
connInfoSecretTarget
object and thename
property. Setname
to the name of the secret for the new Aiven for Valkey resource.
noteBy default, the secret for the new Aiven for Valkey resource gets the
VALKEY
prefix. To keep theREDIS
prefix, add theprefix: REDIS
property in theconnInfoSecretTarget
object.apiVersion: aiven.io/v1alpha1
kind: Valkey
metadata:
name: SERVICE_NAME
spec:
authSecretRef:
name: aiven-token
key: token
connInfoSecretTarget:
name: NEW_VALKEY_SECRET
# prefix: REDIS - Replace
-
Create the Aiven for Valkey resource by applying the configuration:
kubectl apply -f valkey-service.yaml
-
Verify that the Aiven for Valkey secret has been created:
kubectl get secrets
Expected output:
NAME TYPE DATA AGE
OLD_REDIS_SECRET Opaque NN HHMMSS
NEW_VALKEY_SECRET Opaque NN HHMMSS
-
-
Update your applications to use the new Aiven for Valkey secret.
-
Delete your Aiven for Redis resource in Kubernetes:
-
Run
kubectl delete -f redis-service.yaml
Expected output:
redis.aiven.io "SERVICE_NAME" deleted
-
Verify that the Aiven for Valkey secret persists and the Aiven for Redis secret is deleted:
kubectl get secrets
Expected output:
NAME TYPE DATA AGE
NEW_VALKEY_SECRET Opaque NN HHMMSS
-
Related pages
Learn how to update Terraform configuration and state after upgrading to Valkey™.