How to Fork a Valkey Database Cluster

Last verified 8 Jul 2026

Valkey is a high-performance, open-source database that stores key-value data in memory, and is designed for caching, message queues, and primary database use. Fully compatible with Redis, Valkey serves as a drop-in replacement.

You can fork a DigitalOcean Managed Valkey cluster to create a new cluster from an existing cluster’s latest transaction. Forking is a cluster-level action that copies your cluster’s data and configuration settings, such as eviction policies, and creates a separate cluster that you can keep, reconfigure, and run independently from the source cluster.

When you fork a Valkey cluster, you can choose a different configuration for the new cluster. This lets you test workloads with production data, evaluate sizing changes, troubleshoot performance, move data between regions, or create development and testing environments without affecting the source cluster.

Note

Valkey clusters do not support backups or restoring from backups. Forking is the supported way to create a new cluster from an existing cluster’s latest transaction. Forking requires persistence set to rdb, which is the default.

Fork a Database Cluster Using Automation

You can fork a database cluster using the DigitalOcean CLI (doctl) or the API.

Fork a Database Cluster Using the CLI

To fork a cluster using doctl, provide the source cluster ID with --restore-from-cluster-id. Omit --restore-from-timestamp, because Valkey clusters only support forking from their current state.

How to Fork a Database Cluster Using the DigitalOcean CLI
  1. Install doctl, the official DigitalOcean CLI.

  2. Create a personal access token and save it for use with doctl.

  3. Use the token to grant doctl access to your DigitalOcean account.

    doctl auth init
  4. Run doctl databases fork. Basic usage:

    doctl databases fork <name> [flags]

The following example forks a Valkey cluster from the source cluster’s current state. Do not include --restore-from-timestamp:

doctl databases fork <fork-cluster-name> --restore-from-cluster-id <source-cluster-id>

Fork a Database Cluster Using the API

To fork a cluster using the API, create a personal access token and send a POST request to /v2/databases with the standard database cluster attributes and a backup_restore object. Set database_name to the name of the cluster you are forking. Use the /v2/databases/options endpoint to get valid values for engine, version, region, and size.

Valkey clusters only support forking from the latest state. Omit backup_created_at.

See the Create a New Database Cluster API reference for all supported request parameters.

How to Fork a Database Cluster Using the DigitalOcean API

cURL

Send a POST request to https://api.digitalocean.com/v2/databases using cURL:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{
    "name": "<fork-cluster-name>",
    "engine": "valkey",
    "version": "8",
    "region": "<region>",
    "size": "db-s-1vcpu-1gb",
    "num_nodes": 1,
    "backup_restore": {
      "database_name": "<source-cluster-name>"
    }
  }' \
  "https://api.digitalocean.com/v2/databases"

Go

Using Godo, the official DigitalOcean API client for Go:

import (
    "context"
    "os"

    "github.com/digitalocean/godo"
)

func main() {
    token := os.Getenv("DIGITALOCEAN_TOKEN")

    client := godo.NewFromToken(token)
    ctx := context.TODO()

    createRequest := &godo.DatabaseCreateRequest{
        Name:       "<fork-cluster-name>",
        EngineSlug: "valkey",
        Version:    "8",
        Region:     "<region>",
        SizeSlug:   "db-s-1vcpu-1gb",
        NumNodes:   1,
        BackupRestore: &godo.DatabaseBackupRestore{
            DatabaseName: "<source-cluster-name>",
        },
    }

    cluster, _, err := client.Databases.Create(ctx, createRequest)
}

Python

Using PyDo, the official DigitalOcean API client for Python:

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

create_req = {
  "name": "<fork-cluster-name>",
  "engine": "valkey",
  "version": "8",
  "region": "<region>",
  "size": "db-s-1vcpu-1gb",
  "num_nodes": 1,
  "backup_restore": {
    "database_name": "<source-cluster-name>"
  }
}

create_resp = client.databases.create_cluster(body=create_req)

Fork a Database Cluster Using the Control Panel

To fork a database cluster, go to the Databases page and locate the cluster you want to fork. Click the cluster’s menu and select Fork database cluster.

Databases page showing a cluster's expanded ... menu, and the Fork database cluster option highlighted

Choose a State

On the Fork database cluster page, under Choose a state, the only option is Latest Transaction, because Valkey clusters can only be forked from their current state. This creates a copy of your database at the time the Fork database cluster page loads. It doesn’t include transactions that occur after the page loads. To capture the latest changes, refresh the page before forking.

Update the Cluster Configuration

You can update the forked cluster’s configuration using the following options:

  • Choose a database configuration: You can change the type of disk or choose a different plan for the forked cluster. You can also add standby nodes.

  • Choose a datacenter region: You can select the same datacenter or a different datacenter for the forked cluster.

Finalize and Create

In the Finalize and Create section, enter a unique name, and then select a project for the forked cluster.

Review the monthly cost and hourly prorate. Billing stops when you destroy the cluster.

When finished, click Fork Database Cluster.

Creating a fork takes longer than creating a new cluster because the source cluster’s data and configuration settings are copied to the fork during provisioning.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.