CorefinityCorefinityDocs
Open the Control PanelControl Panel
Copies · 4 of 4

Preview a copy onto an environment

Checks a copy of {site} onto another environment: what would move, what blocks it now (blockers), what it would wait for (waits), and the preview_token that cloneSite must quote within 15 minutes. Ask with the same target, scope and snapshot you will send; you need to be able to change both environments.

GET/api/corestack/sites/{site}/clone/preview

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

Query parameters

target_typestring

environment (with target_id) or production, which copies onto the website's production.

environmentproduction
target_idinteger

For environment, the site row id of the environment to copy onto. At least 1.

scopestring

What to copy. Files and database when left out.

files_dbdbfiles
snapshot_idinteger

Copy from this snapshot of the source instead of the live environment. At least 1.

anonymiseboolean

Ask about an anonymised copy (Shopware only). true or false; 1 and 0 are taken too, and anything else is refused invalid.

Returns

200 The preview. can_proceed says whether a copy sent now would be taken.

Fields of the 200 answer
anonymiseobject

Present for a Shopware source only. Whether an anonymised copy can be made, and why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
blockersarray of objectsRequired

What stops the copy now. Each has a reason and a message.

Fields of each item
messagestringRequired
reasonstringRequired
can_proceedbooleanRequired

Whether a copy sent now would be taken, started or queued.

crypt_matchboolean or nullRequired

For Magento 2, whether both environments use the same encryption key. Null when not established.

estimated_secondsinteger or nullRequired

How long the data is expected to take to copy. Null when the size is not known.

estimated_switch_secondsinteger or nullRequired

How long the target is expected to be switched over for.

expected_switchobject or any or nullRequired

What the switch-over involves. Null when no target was named.

expires_atstringRequired

When the token stops being accepted. Format: date-time.

fixupsarray of stringsRequired

What is adjusted on the target after the copy, in plain words.

preview_tokenstringRequired

Quote this in cloneSite within 15 minutes.

queuesboolean

Whether a copy sent now would wait its turn (202) instead of starting.

safety_snapshotbooleanRequired

Whether a safety copy of the target can be kept first.

scopestringRequired

What a copy takes: files and database, the database only, or files only.

files_dbdbfiles
sizesobjectRequired

What would be copied, as last measured. Every figure is null until the environment has been measured.

Fields
basisstring or nullRequired

What was measured, such as volume for the space used on the environment's disk.

copied_bytesinteger or nullRequired
db_bytesinteger or nullRequired
files_bytesinteger or nullRequired
measured_atstring or nullRequired

When the figures were measured. Format: date-time.

scratch_bytesinteger or nullRequired
used_bytesinteger or nullRequired
sourceobjectRequired

One environment of a website, addressed by its site row.

Fields
env_idstringRequired

The environment's platform identifier.

hostnamestringRequired

The environment's own address on the platform.

idintegerRequired

The site row id, the {site} every /corestack/sites/{site} endpoint takes.

namestringRequired
rolestringRequired

The environment's role, such as production or staging.

role_labelstringRequired
slugstringRequired
platformstringRequired

The application, such as wordpress or magento2.

tierstring or nullRequired

The environment's size.

stepsarray of objectsRequired

The steps the copy goes through, in order.

Fields of each item
keystringRequired

A stable key for the line.

labelstringRequired

The line in plain words.

targetobject or any or nullRequired

The environment the copy goes onto. Null when no target was named.

target_diskobject or any or nullRequired

The target's disk. Null when no target was named.

target_growthobject or any or null

When the target is too small for the data and a larger size fixes it, that size, what it adds each month and whether it is bought automatically. Null otherwise.

waitsarray of objects

What a copy sent now would wait for before it starts by itself.

Fields of each item
messagestringRequired
reasonstringRequired

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl https://manage.corefinity.com/api/corestack/sites/1042/clone/preview \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "blockers": [],
  "can_proceed": true,
  "crypt_match": null,
  "estimated_seconds": null,
  "estimated_switch_seconds": 30,
  "expected_switch": {
    "compute": {
      "from": null,
      "to": null
    },
    "crosses_tier": false,
    "note": null,
    "storage": {
      "from": null,
      "to": null
    }
  },
  "expires_at": "2026-11-03T07:15:00Z",
  "fixups": [
    "URLs rewritten to harbourandfinch-example-com-staging.northwind.cfstack.example.net",
    "Crons switched off",
    "Outbound mail captured by Mailpit",
    "Search engines blocked (noindex)",
    "WordPress admin password reset (shown once)"
  ],
  "preview_token": "cp_Xq7mR2vK9sLp4TzW8nBd",
  "queues": false,
  "safety_snapshot": true,
  "scope": "files_db",
  "sizes": {
    "basis": null,
    "copied_bytes": null,
    "db_bytes": null,
    "files_bytes": null,
    "measured_at": null,
    "scratch_bytes": null,
    "used_bytes": null
  },
  "source": {
    "env_id": "rs-northwind-harbourandfinch-example-com",
    "hostname": "harbourandfinch-example-com.northwind.cfstack.example.net",
    "id": 1042,
    "name": "Production",
    "platform": "wordpress",
    "role": "production",
    "role_label": "Production",
    "slug": "production",
    "tier": "S"
  },
  "steps": [
    {
      "key": "snapshot",
      "label": "Snapshots taken"
    },
    {
      "key": "bound",
      "label": "Prepared on the cluster"
    },
    {
      "key": "holding",
      "label": "Disk slot held"
    },
    {
      "key": "stopped",
      "label": "Target stopped"
    },
    {
      "key": "copied",
      "label": "Data copied"
    },
    {
      "key": "started",
      "label": "Target started"
    },
    {
      "key": "fixups",
      "label": "Target adjusted"
    },
    {
      "key": "cleanup",
      "label": "Tidied up"
    }
  ],
  "target": {
    "env_id": "rs-northwind-harbourandfinch-example-com--staging",
    "hostname": "harbourandfinch-example-com-staging.northwind.cfstack.example.net",
    "id": 1043,
    "name": "Staging",
    "role": "staging",
    "role_label": "Staging",
    "slug": "staging",
    "tier": "S"
  },
  "target_disk": {
    "free_bytes": null,
    "size_bytes": 10737418240,
    "used_bytes": null
  },
  "target_growth": null,
  "waits": []
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT