CorefinityCorefinityDocs
Open the Control PanelControl Panel
Clones and copies · 2 of 8

corestack_site_clone

Copy a site's data.

Scope writeAlso destructive to reveal secretsAlso exec to reveal secretsAsks you to confirmRuns as a taskNo secrets returnedCoreCluster
On this page

When to use it

Copy a row's files and / or database onto one of the site's environments, or onto its production row ("push to live", which overwrites production). Preview it first with corestack_site_clone_preview.

While fast copies onto existing environments are switched on, the finished task also gives safety_snapshot_id: the copy of the target taken before it was replaced. To undo the copy, restore that snapshot onto the target with corestack_restore_create. It is null when no safety copy was taken (safety_first off).

Copying onto an existing environment replaces everything in it. When corestack_copy_preview names the confirmation (confirm.field confirm_name), ask the person to type the environment's name, as the Control Panel's copy dialog does, and send it in confirm_name exactly as the environment is named (confirm.expected_hint). Whenever you send it, it must match, or nothing is started. While fast copies onto existing environments are switched on, a copy of everything (files_db) runs as a swap of the whole environment and the name is then always needed: without it the copy is refused confirm_mismatch, and nothing is started. Onto production, the confirmation is the site's domain, in confirm_domain, and it is always needed.

Onto production, a fast copy runs only where the website's platform can show visitors the holding page for the whole switch; elsewhere the copy uses the standard method, with nothing different to send. If the platform stops being able to show it after a fast copy has started, the copy fails before anything changed, with reason holding_unavailable on the operation (corestack_site_operation_get). Tell the person nothing was changed, and copy again: it then uses the standard method.

A copy that would only have to wait — another copy running or queued on either site, a change in progress on the source or the target (a deployment, a restore, a command), an environment still being set up, a snapshot slot, or the cluster changing package — is not refused: it is queued and starts on its own, first come first served on the site. The task then stays working with the queue's words as its status ("Waiting for another copy on this site to finish. It starts on its own."; the task calls the environment the copy comes from "the environment it copies from"), and follows the copy's operation once it starts (completed with operation, as for a copy that started at once). corestack_site_clone_preview says so beforehand (waits[], queues true). To stop a queued copy before it starts, cancel the task (tasks/cancel, or corestack_task_cancel), or cancel it with corestack_queued_copy_cancel (corestack_environment_list lists every copy waiting onto the site's environments, however it was queued); once it has started it runs to its end. A queued copy that cannot start within 6 hours ends with work_failed saying what it waited for, and staff are told; a rule that fails when it finally starts (the person's rights, the typed confirmation, the sizes) ends it with work_failed in that rule's words, and nothing is copied. A queued copy does not start once the grant that queued it is revoked or has ended.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_site_clone with site_id 4211, target {"type":"environment","environment_id":4212}, scope db. (Copy a site's data.) Tell me what it returned.

Inputs

confirm_domainstringConfirmation

Onto production: the site's domain, typed exactly. Up to 253 characters.

confirm_namestringConfirmation

Onto an environment: its name, typed exactly, as corestack_copy_preview asks. Up to 253 characters.

copy_node_runtimeboolean

Also copy the source's Node.js version and global packages to the target. Needs exec when they turn install scripts on there.

node_acknowledgearray of strings

With copy_node_runtime: what ack_required named, once you have told the person. Up to 1 items.

eol
safety_firstboolean

Snapshot the target first (default true; always on production).

scopestring

What to copy (files_db).

files_dbdbfiles
site_idintegerRequired

The source row. At least 1.

snapshot_idinteger

Copy from a ready snapshot of the source instead. At least 1.

targetobjectRequired
Fields
environment_idinteger

With type environment: the environment's row. At least 1.

typestringRequired
environmentproduction

Your assistant fills in a confirmation only after you agree.

Example call

tools/call
{
  "name": "corestack_site_clone",
  "arguments": {
    "site_id": 4211,
    "target": {
      "type": "environment",
      "environment_id": 4212
    },
    "scope": "db",
    "confirm_name": "Staging"
  }
}

If it is refused

ReasonWhat to do
confirm_mismatchThe typed confirmation does not match, or it is missing: the site's domain onto production, or the environment's name when the copy runs as a swap. The refusal names the argument (confirm_name: the environment's name; confirm_domain: the site's domain). Ask the person for the exact value. Nothing was started.
copy_queuedA copy onto that target is already queued. Wait for it to start, or cancel it (its task, or corestack_queued_copy_cancel with its id from corestack_environment_list), then call again. Nothing was started.
different_clusterThe objects are on different clusters; choose rows on the same cluster.
too_small. Resize the target to Medium (100 GB) or larger first."): the target environment's disk is too small for the data. When the message says to resize, ask the person to resize the target to that size with corestack_environment_resize (price it first with corestack_billing_quote_preview), then copy again. When it says production is sized by its package, or to contact support, there is no resize to make here: tell the person. Nothing was started, bought or billed. A company that turned on automatic upgrades has the target grown first instead (target_busy below), within the monthly limit it set.
target_busyFirst, as an automatic upgrade you turned on. Start the copy again once it has finished."): the company turned on automatic upgrades, so the copy resized the target first, priced as a resize and counted against the company's monthly limit. Follow the resize (corestack_site_operations_list on the target) and copy again once it has finished. Any other target_busy: the target has a change in progress; wait for it to finish.
invalid_argumentsOn target beginning "The source disk is larger than the target's.": the data was not measured, so the disks are compared; the rest of the message names the size to resize the target to, or says production's package or support is needed, as for too_small.
capacity_blockedThere is not enough capacity for this; check corecluster_capacity_check or choose another size.
legacy_searchOn target (message: "This site's search runs on a temporary older engine. Switch the store to the OpenSearch module first."): the source's search runs on a temporary older engine, so it is not pushed to live. Tell the person to switch the store to the OpenSearch module first; a copy into another staging environment is still allowed.
snapshot_transferOn snapshot_id (message: "A saved snapshot can be copied only to an environment on the same servers for now, and these two environments are on different servers. Copy the live environment instead, or restore the snapshot to an environment on the same servers."): the target runs on other servers than the source (a staging environment on a tier of its own, for example), and a saved snapshot is not copied across. corestack_site_clone_preview lists it in blockers first. Tell the person they can copy the live environment instead (call again without snapshot_id), or restore the snapshot to an environment on the same servers. Nothing was started. Where it is switched on and both servers can, a saved snapshot on other servers is sent to the target environment's servers first instead, and the copy then runs as usual (it takes longer: the send is part of it). snapshot_transfer stays for a snapshot the servers cannot send.
ack_requiredThe change needs the person's acknowledgements first; required[] lists them — confirm with the person, then call again with them.
managed_elsewhereAnother control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
rate_limitedThe person has started as many copies this minute as the limit allows (5 by default, shared with the Control Panel and the API). A copy that is refused does not count; one that waits its turn does. Wait retry_after_seconds, then call again.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT