---
title: Copy an install
url: https://developers.wpengine.com/docs/managed-hosting-platform/api/reference/operations/copyinstall/
image: https://developers.wpengine.com/og/docs/managed-hosting-platform/api/reference/operations/copyinstall.png
---

# Copy an install

POST

/install_copy

Select code sample

```sh
curl --request POST \
  --url https://api.wpengineapi.com/v1/install_copy \
  --header 'Authorization: Basic <credentials>' \
  --header 'Content-Type: application/json' \
  --data '{ "source_environment_id": "8f14e45f-ceea-4b5b-9f6d-8f14e45fceea", "destination_environment_id": "c9f0f895-fb98-4f3c-9f0f-c9f0f895fb98", "notification_emails": [ "example" ], "custom_options": { "include_files": true, "include_db": true, "db_tables": [ "wp_posts", "wp_comments" ] } }'
```

-

Copies the file system and database from one environment to another. Use `custom_options` to limit what is copied.

## Limitations & Warnings

- The contents of the destination environment are overwritten.
- The source and destination environments must be on the same account.
- Asynchronous: the addresses in `notification_emails` are notified when the copy is complete.
- `db_tables` cannot be specified if `include_db` is `false`.

## Authorizations

- **[basicAuth](https://developers.wpengine.com/docs/managed-hosting-platform/api/reference/#basicauth)**

## Request Bodyrequired

##### Properties

- source_environment_id - **required** - The ID of the environment to copy from. Must be on the same account as destination_environment_id

- destination_environment_id - **required** - The ID of the environment to copy to. The contents of this environment will be overwritten. Must be on the same account as source_environment_id

- notification_emails - **optional** - An array of email addresses to notify when the copy is complete

- custom_options - **optional** - Optional fields to customize how the install should be copied

  - include_files - **optional** - Should files be copied? Boolean where true means include files in the copy. Default is true.
  - include_db - **optional** - Should the database be copied? Boolean where true means include the database in the copy. Default is true.
  - db_tables - **optional** - A list of tables to include in the copy. If unspecified, the full database will be copied. Cannot specifiy tables if `include_db` is `false`.

Media typeapplication/json

object

**source_environment_id**

required

The ID of the environment to copy from

string format: uuid

### Example

```
8f14e45f-ceea-4b5b-9f6d-8f14e45fceea
```

**destination_environment_id**

required

The ID of the environment to copy to

string format: uuid

### Example

```
c9f0f895-fb98-4f3c-9f0f-c9f0f895fb98
```

**notification_emails**

An array of email addresses to notify when the copy is complete

Array\<string>

**custom_options**

Optional fields to customize how the install should be copied

object

**include_files**

Should files be included in the copy. True means include files. Default is true.

boolean

**include_db**

Should the database be included in the copy. True means include the database. Default is true.

boolean

**db_tables**

A list of tables to include in the copy. If unspecified, the full database will be copied. Cannot specifiy tables if `include_db` is `false`.

Array\<string>

### Example

```json
[
  "wp_posts",
  "wp_comments"
]
```

## Responses

### 202

Accepted. The copy has been accepted; the addresses in `notification_emails` are notified when it is complete.

### 400

Bad Request

Media typeapplication/json

object

**message**

required

A message regarding the error that occurred on the server

string

**documentation_url**

(Optional) A URL where documentation regarding this specific error can be found

string

**errors**

An array of error objects describing specific errors that arose when servicing the request

Array\<object>

object

**resource**

required

The name of the resource that was being processed when the error occurred

string

**field**

required

(Optional) The specific field associated with the error

string

**type**

required

(Optional) A type associated with the error. `invalid_value`, `access_error`, `value_unavailable`

string

**code**

required

(Optional) A machine code relating to the error that occurred with the field and resource

string

**message**

required

(Optional) A human-readable message relating to the error that occurred with the field and resource

string

#### Example

```json
{
  "message": "Invalid request.",
  "errors": [
    {
      "resource": "Resource",
      "field": "field_name",
      "type": "invalid_value",
      "code": "invalid",
      "message": "The value is invalid."
    }
  ]
}
```

### 401

Authentication Error

Media typeapplication/json

object

**message**

required

A message regarding the error that occurred on the server

string

**documentation_url**

(Optional) A URL where documentation regarding this specific error can be found

string

#### Example

```json
{
  "message": "Bad Credentials"
}
```

### 403

Not authorized

Media typeapplication/json

object

**message**

required

A message regarding the error that occurred on the server

string

**documentation_url**

(Optional) A URL where documentation regarding this specific error can be found

string

#### Example

```json
{
  "message": "You don't have permission to perform that action"
}
```

### 404

Not found

Media typeapplication/json

object

**message**

required

A message regarding the error that occurred on the server

string

**documentation_url**

(Optional) A URL where documentation regarding this specific error can be found

string

#### Example

```json
{
  "message": "Not Found"
}
```

### 429

Too many requests

### 500

Internal Server Error

Media typeapplication/json

object

**message**

required

A message regarding the error that occurred on the server

string

#### Example

```json
{
  "message": "An unexpected error occurred, please try again in a few minutes"
}
```

### 502

An invalid response was received from an upstream server

### 503

Service unavailable

## Was this helpful?

Thanks for the feedback!

```json
{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://developers.wpengine.com/#website","name":"WP Engine Product Documentation","url":"https://developers.wpengine.com/","description":"Resources for developing, deploying, and scaling on WP Engine.","inLanguage":"en-US","keywords":["API documentation","product documentation","headless WordPress","managed WordPress hosting"],"publisher":{"@id":"https://wpengine.com/#organization"}}]}
```
