---
title: How to Fork a Valkey Database Cluster
description: Fork a Valkey database cluster to create a new cluster from an existing cluster&#39;s latest transaction.
product: Databases
url: https://docs.digitalocean.com/products/databases/valkey/how-to/fork-clusters/
last_updated: "2026-08-04"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# How to Fork a Valkey Database Cluster

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`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI.
2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`.
3. Use the token to grant `doctl` access to your DigitalOcean account.

   ```shell
   doctl auth init
   ```
4. Run [`doctl databases fork`](https://docs.digitalocean.com/reference/doctl/reference/databases/fork/index.html.md). Basic usage:

   ```shell
   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`:

```shell
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](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and send a POST request to [`/v2/databases`](https://docs.digitalocean.com/reference/api/reference/databases/index.html.md#databases_create_cluster) 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`](https://docs.digitalocean.com/reference/api/reference/databases/index.html.md#databases_list_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](https://docs.digitalocean.com/reference/api/reference/databases/index.html.md#databases_create_cluster) 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:

```shell
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](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go:

```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](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python:

```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](https://cloud.digitalocean.com/databases) 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](https://docs.digitalocean.com/screenshots/databases/fork-database-cluster.c5eff20634d5f8d054b05a9860938852833648556ac0d233332fbaf842d49dd2.png)

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