Skip to content
WP Engine Documentation

Copy the full file system and database from one WordPress installation to another

POST
/install_copy
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" ] } }'
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 type application/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
[
"wp_posts",
"wp_comments"
]

Accepted

Media type application/json

Bad Request

Media type application/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
{
"message": "Invalid Site: Name cannot be empty.",
"errors": [
{
"resource": "Site",
"field": "name",
"type": "invalid_value",
"code": "too_long",
"message": "Name is too long (maximum is 40 characters)"
}
]
}

Authentication Error

Media type application/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
{
"message": "Bad Credentials"
}

Not authorized

Media type application/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
{
"message": "You don't have permission to perform that action"
}

Not found

Media type application/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
{
"message": "Not Found"
}

Too many requests

Media type application/json

Too many requests

Example generated
example

Internal server error

Media type application/json
object
message
required

A message regarding the error that occurred on the server

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

An invalid response was received from an upstream server

Media type application/json

Service unavailable

Media type application/json