Migrate your Redis and Valkey workloads into Memorystore for Valkey

This document explains how to automate the migration of your self-managed Redis and Valkey workloads into Memorystore for Valkey. Migrating to a fully managed environment eliminates the operational burden of managing your own infrastructure, so you don't have to handle manual OS patching, replication setup, or custom backup scripts. This feature lets you take advantage of built-in automatic failover, secure VPC connectivity, and zero-downtime scaling.

By migrating your self-managed workloads into Memorystore for Valkey, you unlock the following advantages that eliminate operational toil and modernize your database infrastructure:

  • Eliminate your operational overhead: offload manual and time-consuming tasks to Google Cloud, such as OS patching, infrastructure monitoring, backup scripts, and replication management. As a result, you can focus on application development instead of database maintenance.
  • Achieve enterprise-grade high availability: benefit from a fully managed 99.99% SLA. Memorystore for Valkey provides automatic failover and built-in backup and restore capabilities. This protects your applications from unexpected node failures and ensures rapid disaster recovery.
  • Scale with near-zero downtime: dynamically scale your instances in or out to match unpredictable traffic spikes. You can expand to hundreds of nodes (up to 250 shards) without taking your applications offline.
  • Enhance your security: replace complex, manually configured network rules with secure, built-in VPC connectivity and granular Identity and Access Management (IAM)-based access controls. This ensures that Google Cloud's strict security boundaries protect your data.
  • Consolidate and upgrade your instances: merge your scattered, siloed, and self-managed instances into a single, high-performance deployment in Memorystore for Valkey. As part of this migration, you can also automatically upgrade your outdated Redis or Valkey versions to the latest supported releases.
  • Unlock advanced real-time analytics and GenAI: transition to an optimized environment that delivers microsecond latencies for caching and session management. To power your generative AI (GenAI) applications, you gain immediate, managed access to advanced features like Vector Search.

Version support

The table in this section lists the following information about the source Redis and Valkey self-managed instances, and the target instances in Memorystore for Valkey:

  • The types and versions of the source instances that the migration supports
  • The versions of the target Memorystore for Valkey instances to which you can migrate your workloads
Source instance type Source instance version Target instance version
Redis 3.2.x - 7.2.x Valkey 7.2, 8.0, 9.0, and 9.1
Valkey 7.x, 8.x, and 9.x Valkey 7.2, 8.0, 9.0, and 9.1

Before you begin

Before you begin to migrate your workloads, complete the prerequisites in this section.

Use the Google Cloud console, gcloud CLI, and APIs

To use the Google Cloud console, Google Cloud CLI (gcloud CLI), and APIs, do the following:

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  5. Verify that billing is enabled for your Google Cloud project.

  6. Install and initialize the Google Cloud CLI.

    If you installed the gcloud CLI previously, then make sure that you have the latest version by running gcloud components update. To access the Memorystore for Valkey gcloud CLI commands, you need at least gcloud CLI version 489.0.0.

  7. Enable the Memorystore for Valkey API.
    Memorystore for Valkey API
  8. Enable the Network Connectivity API.
    Network Connectivity API
  9. Enable the Service Consumer Management API.
    Service Consumer Management API
  10. Enable the Compute Engine API.
    Compute Engine API

Assign roles and permissions

To migrate your self-managed Redis and Valkey workloads into Memorystore for Valkey, ask your administrator to grant you the Memorystore Admin (roles/memorystore.admin) IAM role on your Google Cloud project. For more information about this role, see Predefined roles.

To create and view network attachments, ask your administrator to grant you the Compute Network Admin (roles/compute.networkAdmin) IAM role on your Google Cloud project. For more information about this role, see Compute Engine roles.

Workflow to migrate your workloads

To migrate your self-managed Redis and Valkey workloads into Memorystore for Valkey, perform the following actions:

  1. Prepare your source instance: configure your self-managed Redis or Valkey instance to allow secure connections and outbound replication to Memorystore for Valkey.
  2. Prepare the target instance: determine your required instance specifications, such as the shard count and node type.
  3. Create the target instance: provision the Memorystore for Valkey instance that receives your migrated data.
  4. Configure a network attachment: set up a network attachment. This attachment lets the target instance (which resides in a Google-managed VPC network) initiate connections to the source instance (which resides in your VPC network). As a result, replication is established.
  5. Start the migration: initiate the synchronization process. The target instance automatically connects to your source instance and continuously replicates your data as a read replica.
  6. Monitor the migration: verify that the migration progresses without issues and that the status of the migration is HEALTHY.
  7. Finish the migration: cut over your application traffic to the target instance.

Prepare your source instance

You must prepare your self-managed Redis or Valkey instance so that you can migrate your workloads into a target Memorystore for Valkey instance.

To allow connections from the nodes of the target instance to the nodes of the source instance, do the following:

  • If you enabled protected-mode on the source nodes, then deactivate it.
  • If you configured the source nodes by using an explicit bind directive, then update the nodes to allow incoming connections from the target nodes. The target nodes initiate connections from the IP addresses in the network attachment's subnet.
  • Update any firewall rules that might block incoming connections from the target nodes.
  • If you enabled authentication and Transport Layer Security (TLS) on the source nodes, then deactivate them.

To let the target nodes establish replication with the source nodes, do the following:

  • Don't rename any Valkey or Redis commands that perform data modification or are used for replication (for example, PING, PSYNC, and HSET).
  • If you use access control lists (ACL) for your instance, then allow the following commands for the default user so that the target instance can establish replication:
    • REPLCONF
    • SYNC
    • PSYNC
    • PING
    • INFO
    • CLUSTER | NODES
  • Ensure that the source instance has enough memory and CPU capacity to manage the additional replication load from the target nodes.

Prepare the target instance

To ensure a smooth replication process, you must size your target Memorystore for Valkey instance appropriately to handle the incoming workload from your source instance. To do this, determine the exact specifications for your target instance. These specifications include the compatibility with the source instance, cluster mode, number of databases, shard count, instance version, and node type.

To prepare the target instance, use the following guidelines:

  • Compatibility with the source instance: the source and target instances must reside in the same Google Cloud project and region.
  • Cluster mode: the cluster mode of the target instance must match the cluster mode of the source instance. If the source instance is Cluster Mode Disabled, then the target instance must also be Cluster Mode Disabled. Otherwise, the target instance must be Cluster Mode Enabled.
  • Number of databases: if the target instance is Cluster Mode Disabled, then the number of logical databases on the instance must be equal to or greater than the number of databases on the source instance.
  • Shard count: if the target instance is Cluster Mode Enabled, then the number of shards on the instance must match the number of shards on the source instance. However, the number of replicas on the source and target instances can be different.
  • Instance version: the version of the target instance must be compatible with the version of the source instance. For more information, see Version support.
  • Maintenance version: the maintenance version of the target instance must be MEMORYSTORE_20260313_01_00 or later. For more information, see About maintenance.
  • Node type: the node type of the target instance must be large enough to handle the data that it receives from source nodes. For more information about the node types that you can select for the target instance and the corresponding keyspace capacity for each node type, see Node type specification.

Create the target instance

If you don't have a target instance that meets the requirements to receive the data that Memorystore for Valkey migrates from the source instance, then you must create the instance.

To create this instance, use the Google Cloud console, the gcloud CLI, or the REST API. For more information about creating the instance, see Create instances.

Configure a network attachment

To migrate the workloads of a source instance into a target instance, the target nodes must connect to the source nodes. To enable this connection, you must use a network attachment. The target nodes initiate connections from the subnet in the source instance's VPC network that's linked to the network attachment.

The following diagram illustrates how a target instance connects to a source instance in a VPC network by using a network attachment and Private Service Connect interfaces.

You can use a network attachment that meets the following requirements:

  • It must reside in the same Google Cloud project and region as the target instance.
  • Its subnet must be located within the same VPC network as the source instance.
  • The subnet for the source instance must have an adequate IP CIDR range that supports a minimum of N+1 usable IP addresses (where N is the number of nodes in the target instance). For example, if a target instance has three shards and one replica, then it has six nodes: three nodes for the primary instance and three nodes for the replica. Therefore, you need at least seven IP addresses.
  • The subnet range can't overlap with 10.0.0.0/23 because Memorystore for Valkey reserves this range.

If your network attachment doesn't meet these requirements or you don't have a network attachment, then you must create one. For more information, see Create network attachments.

Start the migration

By starting the migration, the target instance establishes replication with the source instance. The target instance automatically replicates any data that your application writes to the source instance. The target instance becomes a read replica of the source instance.

To start the migration, use the Google Cloud console, the gcloud CLI, or the REST API.

Console

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

    Memorystore for Valkey

  2. Click the ID of the target instance.

  3. On the Instance at a glance page, click Start migration.

  4. In the Migrate Self Managed Redis and Valkey Instances window, do the following:

  5. On the Prepare tab, read the information about the prerequisites for the source instance and the guidelines for the network attachment. Then, click Continue.

  6. On the Connect tab, do the following:

    1. Enter the IP Address and Port of the source instance. You noted this information in Prepare your source instance.
    2. Select the network attachment that you want to use to migrate data.
    3. Click Continue.
  7. On the Review tab, review the information that's associated with the migration process. This information includes the ID of the target instance, the IP address and port of the source instance, and the name of the network attachment. After reviewing this information, click Start migration.

  8. On the Instance at a glance page, verify that a Migrating status appears.

If the target nodes can't connect to the source nodes, or if the source instance can't replicate data to the target instance, then the migration fails.

When this occurs, Memorystore for Valkey rolls back the target instance to its state before you started the migration process. The status of the target instance reverts to Ready, and the instance has both read and write capabilities again.

After you resolve the issues that caused the migration to fail, you can start the migration again.

gcloud

Use the gcloud memorystore instances start-migration command, as follows:

gcloud memorystore instances start-migration INSTANCE_ID \
--project=PROJECT_ID \
--location=REGION_ID \
--source-ip=SOURCE_IP_ADDRESS \
--source-port=SOURCE_PORT \
--network-attachment=projects/PROJECT_ID/locations/REGION_ID/networkAttachments/NETWORK_ATTACHMENT_ID

Make the following replacements:

  • INSTANCE_ID: the ID of the target instance.
  • PROJECT_ID: the ID or project number of the Google Cloud project that contains this instance.
  • REGION_ID: the ID of the region where the instance is located.
  • SOURCE_IP_ADDRESS: the IP address of the source instance. You noted this IP address in Prepare your source instance.
  • SOURCE_PORT: the port number of the source instance. You noted this port in Prepare your source instance.
  • NETWORK_ATTACHMENT_ID: the ID of the network attachment.

To confirm that the migration has started successfully, use the gcloud memorystore instances describe command, as follows:

gcloud memorystore instances describe INSTANCE_ID \
--project=PROJECT_ID \
--location=REGION_ID

Verify that a MIGRATING status appears next to the state parameter.

If the target nodes can't connect to the source nodes, or if the source instance can't replicate data to the target instance, then the migration fails.

When this occurs, Memorystore for Valkey rolls back the target instance to its state before you started the migration process. The status of the target instance reverts to ACTIVE, and the instance has both read and write capabilities again.

After you resolve the issues that caused the migration to fail, you can start the migration again.

REST

To start the migration, use the following REST API command.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the ID or project number of the Google Cloud project that contains the target instance.
  • REGION_ID: the ID of the region where this instance is located.
  • INSTANCE_ID: the ID of the instance.
  • SOURCE_IP_ADDRESS: the IP address of the source instance. You noted this IP address in Prepare your source instance.
  • SOURCE_PORT: the port number of the source instance. You noted this port in Prepare your source instance.
  • NETWORK_ATTACHMENT_ID: the ID of the network attachment.

HTTP method and URL:

POST https://memorystore.googleapis.com/v1/projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID:startMigration

Request JSON body:

{
  "selfManagedSource": {
    "ipAddress": "SOURCE_IP_ADDRESS",
    "port": SOURCE_PORT,
    "networkAttachment": "projects/PROJECT_ID/regions/REGION_ID/networkAttachments/NETWORK_ATTACHMENT_ID"
  }
}

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

{
  "name": "projects/PROJECT_ID/locations/REGION_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.memorystore.v1.OperationMetadata",
    "createTime": "2026-10-26T20:00:00.000000000Z",
    "target": "projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID",
    "verb": "startMigration",
    "requestedCancellation": false,
    "apiVersion": "v1"
  },
  "done": false
}

Monitor the migration

To ensure that the migration progresses without issues, monitor both the source and target instances.

Monitor the source instance

On the source instance, verify that the client output buffer usage remains low on the source nodes. To check the buffer usage, do one of the following:

  • Use your existing monitoring dashboards
  • Connect to your source instance with your Redis or Valkey client, and then run the INFO CLIENTS command to check the output buffer metrics

Sustained low usage indicates a minimal lag and a successful synchronization of the data from the source instance to the target instance.

Monitor the target instance

You can monitor the health of the migration from the source instance to Memorystore for Valkey. To do this, check the Migration status (/instance/migration_status) metric for the target instance to verify that the current status of the instance is HEALTHY. This status indicates that the replication links between the shards of the source and target instances are active and functioning correctly during the migration process.

To check the Migration status metric for the instance using the Google Cloud console, do the following:

  1. In the Google Cloud console, go to the Metrics explorer page.

    Metrics explorer

  2. From the Metric menu, select the Migration status metric. To do this, select Memorystore Instance  > Instance  > Migration status, and then click Apply.

  3. From the Filter field, add the following filter: instance_id = (equals) INSTANCE_ID.

    Replace INSTANCE_ID with the ID of the target instance.

  4. In the Results section, check the current status of the instance. If a HEALTHY status appears, then the instance is functioning, and you can finish the migration.

    If the HEALTHY status doesn't appear, then you can use the Migration status metric for the primary nodes of the target instance. By monitoring these nodes, you can determine whether any specific node isn't healthy.

    To use the Migration status metric for the instance nodes, do the following:

    1. From the Metric menu, select the Migration status metric. To do this, select Memorystore Instance Node  > Instance  > Migration status, and then click Apply.

    2. From the Filter field, add the following filter: role = (equals) primary.

    3. In the Results section, verify that the current status of all primary nodes is HEALTHY. If the status is HEALTHY, then the nodes are functioning and you can finish the migration.

Finish the migration

To finish the migration, use the Google Cloud console, the gcloud CLI, or the REST API.

Console

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

    Memorystore for Valkey

  2. Click the ID of the target instance.

  3. On the Instance at a glance page, click Finish migration.

  4. In the Finish migration dialog, do the following:

    1. If you want to ensure that the target instance replicates all data from the source instance, then select Standard.

    2. In the Instance ID text field, enter the ID of the target instance.

    3. Click Finish migration.

  5. On the Instance at a glance page, verify that a Migrated status appears.

gcloud

Use the gcloud memorystore instances finish-migration command, as follows:

gcloud memorystore instances finish-migration INSTANCE_ID \
--project=PROJECT_ID \
--location=REGION_ID

Make the following replacements:

  • INSTANCE_ID: the ID of the target instance
  • PROJECT_ID: the ID or project number of the Google Cloud project that contains this instance
  • REGION_ID: the ID of the region where the instance is located

To confirm that the migration finishes successfully, use the gcloud memorystore instances describe command, as follows:

gcloud memorystore instances describe INSTANCE_ID \
--project=PROJECT_ID \
--location=REGION_ID

Verify that a MIGRATED status appears next to the state parameter.

REST

To finish the migration, use the following REST API command.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the ID of the Google Cloud project that contains the target instance.
  • REGION_ID: the ID of the region where this instance is located.
  • INSTANCE_ID: the ID of the instance.
  • FORCE_BOOLEAN: optional. This parameter determines whether Memorystore for Valkey forces the migration to finish immediately.

    • If you set this parameter to true, then Memorystore for Valkey finishes the migration immediately so that you can cut over your application traffic to the target instance. However, Memorystore for Valkey might not be able to replicate all data from the source instance to the target instance.
    • If you set this parameter to false, then Memorystore for Valkey replicates all data from the source instance to the target instance up to the time that you finish the migration.

HTTP method and URL:

POST https://memorystore.googleapis.com/v1/projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID:finishMigration

Request JSON body:

{
  "force": FORCE_BOOLEAN
}

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

{
  "name": "projects/PROJECT_ID/locations/REGION_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.memorystore.v1.OperationMetadata",
    "createTime": "2026-10-26T20:00:00.000000000Z",
    "target": "projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID",
    "verb": "finishMigration",
    "requestedCancellation": false,
    "apiVersion": "v1"
  },
  "done": false
}