---
title: "corestack_snapshot_restore_to"
url: https://docs.corefinity.com/mcp/tools/corestack_snapshot_restore_to
type: tool
last_updated: 2026-11-13
feature: restores
related:
  - https://docs.corefinity.com/guides/sites/backups/restore-anywhere.md
---
# corestack_snapshot_restore_to

**Restore a snapshot elsewhere.** Restore a snapshot into a new environment, another existing environment, production (which it overwrites) or a new website. Preview it first with corestack_restore_preview. Scope: write. Also needs destructive when the target is production. Also needs exec when reveal_to_agent is true. Long-running: answers with a task. The secret opens in the person's browser; set reveal_to_agent to true to receive it yourself (needs exec).

- Scope: `write`
- Also needs `destructive` when the target is production
- Also needs `exec` when a new target's HTTP-auth login
- Confirmation: `confirm_domain`, `confirm_name`
- Runs as a task: yes
- Returns a secret only when `reveal_to_agent` is set

## When to use it

Restore a snapshot somewhere other than the row it was taken of: into a new environment of a website, over another existing environment, over production, or into a new website. Preview it first with `corestack_restore_preview`, which also tells you the confirmation to type. To restore a snapshot onto its own row, use `corestack_restore_create`.

The answer is a task that follows the restore: read it with `corestack_restore_get`, and the copy's steps with `corestack_operation_timeline_get`. An overwrite takes a safety snapshot first, so it can be undone. A new environment is born with an HTTP-auth login: it opens in the person's browser, or with `reveal_to_agent` it is returned to you (needs exec); `corestack_http_auth_reveal_password` shows it again later.

When the snapshot's PHP version is not open to new sites yet (just after a PHP security update, before its tested release is opened), a restore to a new environment or a new site is not refused: it keeps the snapshot's versions, so it waits for that version (`version_wait` with `kind` `php`) and goes on by itself once it is open. If by then the copy can no longer be made as planned, it keeps waiting with the status "Waiting for our team to prepare the copy"; it is never failed. corestack_restore_preview answers the same way. The snapshot cannot be deleted until the restore has finished.

## Inputs

- `snapshot_id` (integer, required): the snapshot to restore.
- `target` (object, required): as `corestack_restore_preview` takes it, with `kind` one of `new_environment`, `existing_environment`, `production` or `new_site`.
- `scope` (string): for an overwrite, `everything` (the default), `files` or `database`.
- `anonymise` (boolean): anonymise the copy. Never for production.
- `confirm_name` (string): for `existing_environment`, the environment's name, typed exactly.
- `confirm_domain` (string): for `production`, its domain, typed exactly. Restoring over production needs the destructive scope.
- `reveal_to_agent` (boolean): return a new environment's HTTP-auth login to you instead of opening it in the person's browser. Needs exec.

A creating target takes neither confirmation. A new website is a create, which a token with pins cannot start; a new environment needs a pin on its whole website.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "anonymise": {
      "description": "Anonymise the copy (non-production targets only).",
      "type": "boolean"
    },
    "confirm_domain": {
      "description": "production: its domain, typed exactly.",
      "maxLength": 253,
      "minLength": 3,
      "type": "string"
    },
    "confirm_name": {
      "description": "existing_environment: its name, typed exactly.",
      "maxLength": 191,
      "minLength": 1,
      "type": "string"
    },
    "reveal_to_agent": {
      "default": false,
      "description": "Return the secret to you instead of opening it in the person's browser. Needs exec.",
      "type": "boolean"
    },
    "scope": {
      "description": "An overwrite: what to restore (everything).",
      "enum": [
        "everything",
        "files",
        "database"
      ],
      "type": "string"
    },
    "snapshot_id": {
      "minimum": 1,
      "type": "integer"
    },
    "target": {
      "additionalProperties": false,
      "description": "existing_environment / production: site_id; new_environment: parent_site_id (+ name, uat_size or tier); new_site: product with cluster_id (corecluster) or placement + package (corestack).",
      "properties": {
        "cluster_id": {
          "minimum": 1,
          "type": "integer"
        },
        "compute_family": {
          "maxLength": 32,
          "minLength": 1,
          "type": "string"
        },
        "domain": {
          "maxLength": 253,
          "minLength": 3,
          "type": "string"
        },
        "kind": {
          "enum": [
            "new_environment",
            "existing_environment",
            "production",
            "new_site"
          ],
          "type": "string"
        },
        "name": {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        "package": {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        "parent_site_id": {
          "minimum": 1,
          "type": "integer"
        },
        "placement": {
          "additionalProperties": false,
          "properties": {
            "cluster_id": {
              "minimum": 1,
              "type": "integer"
            },
            "kind": {
              "enum": [
                "platform",
                "cluster"
              ],
              "type": "string"
            },
            "region": {
              "pattern": "^[a-z]{2,4}$",
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "type": "object"
        },
        "product": {
          "enum": [
            "corestack",
            "corecluster"
          ],
          "type": "string"
        },
        "site_id": {
          "minimum": 1,
          "type": "integer"
        },
        "slug": {
          "pattern": "^[a-z][a-z0-9-]{1,15}$",
          "type": "string"
        },
        "tier": {
          "maxLength": 32,
          "minLength": 1,
          "type": "string"
        },
        "uat_size": {
          "maxLength": 16,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    }
  },
  "required": [
    "snapshot_id",
    "target"
  ],
  "type": "object"
}
```

## Refusals

- `confirm_mismatch`: what was typed does not match; the refusal names the argument. Nothing was started.
- `anonymise_production`: production is never anonymised.
- `copy_target_staging_only`: this website's copies are for staging only and cannot replace production.
- `legacy_search` (message: "This site's search runs on a temporary older engine. Switch the store to the OpenSearch module first."): the snapshot is of a site whose search runs on a temporary older engine, so it is not restored into production or a new website. Tell the person to switch the store to the OpenSearch module first; restoring into a staging environment is still allowed.
- `snapshot_unavailable`, `final_expired`, `mariadb_change`, `target_too_small`, `cross_region`, `anonymise_unsupported`, `not_offered`, `not_permitted`, `commerce_keys_required`, `busy`: this restore cannot be made as asked now; the message says why. `not_offered` with "This WordPress site is built with Bedrock, so it can only be copied to a site that deploys the same way. For a staging copy, use a branch (Git) environment.": the snapshot is of a WordPress site built with Bedrock that deploys from Git and the target deploys manually (a new environment or website always does); restore only the database (`scope` `database`), or use a branch (Git) environment.
- `snapshot_transfer` (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."): over an existing environment or production that runs on other servers than the row the snapshot was taken from, the restore would copy the snapshot across, which a saved snapshot is not for now. corestack_restore_preview lists it first. Tell the person they can copy the live environment instead (corestack_site_clone 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's servers first instead, and the restore then runs as usual (it takes longer: the send is part of it). `snapshot_transfer` stays for a snapshot the servers cannot send.
- `runtime_unprepared`: the destination environment needs a platform update before it can take this restore; nothing was changed. Tell the person to contact Corefinity support to update it; retrying cannot help.
- `feature_off`: restoring this way, onto a new website, from a deleted row or with anonymising, is not switched on for the company.
- `temporarily_unavailable`: the restore cannot be made just now. Nothing was changed; try again in a few minutes.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another 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_limited`: the person has started as many restores this minute (10 by default), or the company this hour (30 by default), as the limits allow, shared with the Control Panel and the API. A restore that is refused does not count. Wait `retry_after_seconds`, then call again.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_snapshot_restore_to",
  "arguments": {
    "snapshot_id": 812,
    "target": {
      "kind": "existing_environment",
      "site_id": 311
    },
    "scope": "database",
    "confirm_name": "Staging"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_snapshot_restore_to with snapshot_id 812, target {"kind":"existing_environment","site_id":311}, scope database. (Restore a snapshot elsewhere.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [Restore anywhere](https://docs.corefinity.com/guides/sites/backups/restore-anywhere.md)
