---
title: "Clone Environment Database"
method: POST
path: "/v0/sites/{site_id}/environments/{env_id}/database/clone"
tags: ["sites"]
---

# Clone Environment Database

`POST /v0/sites/{site_id}/environments/{env_id}/database/clone`

## Request

- Base URL: `https://api.pantheon.io`
- URL: `https://api.pantheon.io/v0/sites/{site_id}/environments/{env_id}/database/clone`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/pantheon/apis/pantheon-public-api-service/docs/v0/sites/:site_id/environments/:env_id/database/clone/post.ts> (a function with typed inputs; its response is checked against the schema)

Clones the database from another environment.

## Path parameters

- `site_id` string, required
- `env_id` string, required

## Request body

- CloneDatabaseRequest
  - `clear_cache` boolean: Whether to clear cache after cloning
  - `from_environment` string, required: Source environment to clone from
  - `from_url` string: Source URL for WordPress search-replace (optional, for WordPress sites)
  - `to_url` string: Target URL for WordPress search-replace (optional, for WordPress sites)
  - `updatedb` boolean: Whether to run database updates after cloning

## Response `200`

- WorkflowCreationResponse
  - `active_description` string: Active description of the workflow
  - `id` string, required: Workflow ID
  - `number_of_tasks` integer: Number of tasks in the workflow

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/pantheon/apis/pantheon-public-api-service.md) - [All operations](https://skmtc.dev/pantheon/apis/pantheon-public-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/pantheon/apis/pantheon-public-api-service/revisions/5d158d59f4c3?raw)
