How to Fork an OpenSearch Database Cluster

Last verified 8 Jul 2026

OpenSearch is an open-source search and analytics suite which serves as a centralized location to manage logs forwarded from other resources, such as databases and Droplets.

Forking a database cluster creates a new cluster from an existing cluster based on a specific point in time or the latest transaction. Forking is a cluster-level action that copies the source cluster’s data and configuration settings.

You can fork from any point in time within the last 7 days, the same range covered by the 7-day restoration window. A fork creates a new cluster from that state, which you can keep, reconfigure, and run separately from the source cluster. You can use a fork to test applications with production data, migrate to another datacenter region, or preserve a point-in-time copy for analysis.

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. To fork from a point in time, add --restore-from-timestamp with a timestamp within the last 7 days. If you omit --restore-from-timestamp, the fork uses the source cluster’s latest 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. Finally, run doctl databases fork. Basic usage looks like this, but you can read the usage docs for more details:
    doctl databases fork <name> [flags]

The following example forks a database cluster with the ID f81d4fae-7dec-11d0-a765-00a0c91e6bf6 to create a new database cluster. The command also uses the --restore-from-timestamp flag to specifically fork the database from a cluster backup that was created on 2023 November 7:

doctl databases fork new-db-cluster --restore-from-cluster-id f81d4fae-7dec-11d0-a765-00a0c91e6bf6 --restore-from-timestamp 2023-11-07 12:34:56 +0000 UTC

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.

To fork from a point in time, set backup_created_at to a timestamp within the last 7 days. If you omit backup_created_at, the fork uses the source cluster’s latest state.

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": "opensearch",
    "version": "2.19",
    "region": "<region>",
    "size": "os-s-1-2-40-dd",
    "num_nodes": 1,
    "backup_restore": {
      "database_name": "<source-cluster-name>",
      "backup_created_at": "2026-07-01T12:00:00Z"
    }
  }' \
  "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: "opensearch",
        Version:    "2.19",
        Region:     "<region>",
        SizeSlug:   "os-s-1-2-40-dd",
        NumNodes:   1,
        BackupRestore: &godo.DatabaseBackupRestore{
            DatabaseName:    "<source-cluster-name>",
            BackupCreatedAt: "2026-07-01T12:00:00Z",
        },
    }

    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": "opensearch",
  "version": "2.19",
  "region": "<region>",
  "size": "os-s-1-2-40-dd",
  "num_nodes": 1,
  "backup_restore": {
    "database_name": "<source-cluster-name>",
    "backup_created_at": "2026-07-01T12:00:00Z"
  }
}

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, you can choose from two states:

  • Latest Transaction: 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.

  • Point in Time: This creates a copy of your database at a specific point in time within the last 7 days. Use the Date, Hrs, Mins, and Secs dropdown menus to specify the date and time.

The Choose a point in time option, showing dropdown menus for Date, Hrs, Mins, and Secs

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. Most plans also let you select a number of nodes.

  • Choose a storage size: You can adjust the storage size within the supported range of the plan you select. You can also enable autoscaling.

  • 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. All databases and users from the source cluster are copied to the fork, including the required doadmin user.

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.