---
title: "corestack_deployments_pipeline_copy"
url: https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_copy
type: tool
last_updated: 2026-11-13
feature: deployment-pipeline
related:
  - https://docs.corefinity.com/api/reference/deployments/copy-site-deployment-pipeline.md
  - https://docs.corefinity.com/guides/sites/code-and-deployments/pipeline-stages.md
---
# corestack_deployments_pipeline_copy

**Copy a pipeline from another environment.** Copy parts of another environment's deployment setup onto this binding: its stages, settings, variables, registry secrets or deployment options. Run it with dry_run first: it answers what would be added, overwritten or left unchanged, names only. Values never pass through you. Scope: write. Also needs exec when the deployment pipeline gains a custom line.

- Scope: `write`
- Also needs `exec` when custom lines the target does not hold
- Confirmation: `confirm_production`
- Runs as a task: no

## When to use it

Copy parts of another environment of the same site onto this binding: its `stages`, `settings`, `variables`, registry `secrets` or deployment `options`. Run it with `dry_run: true` first: it writes nothing and answers per part what would be added, overwritten or left unchanged, by name only. Variables and secrets are copied inside the Control Panel, never through you. The target's previous version stays restorable. Your access must cover both environments; copying onto production needs `confirm_production: true`; stages that bring a custom line this binding does not run also need exec.

The same action in the public REST API, with the same checks, refusals and scope: `POST /api/corestack/sites/{site}/deployments/pipeline/{binding}/copy`.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `binding_id` (integer, ≥ 1): Default: the environment's default binding.
- `from_site_id` (integer, ≥ 1, required): Another environment of the same site.
- `from_binding_id` (integer, ≥ 1): Default: that environment's repository binding.
- `parts` (array of string, each one of `stages`, `settings`, `variables`, `secrets`, `options`, 1 to 5 items, required)
- `revision` (string, required): This binding's pipeline revision you read.
- `dry_run` (boolean): Write nothing; answer what would change.
- `confirm_production` (boolean): Required to copy onto a production environment.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "binding_id": {
      "description": "Default: the environment's default binding.",
      "minimum": 1,
      "type": "integer"
    },
    "confirm_production": {
      "description": "Required to copy onto a production environment.",
      "type": "boolean"
    },
    "dry_run": {
      "description": "Write nothing; answer what would change.",
      "type": "boolean"
    },
    "from_binding_id": {
      "description": "Default: that environment's repository binding.",
      "minimum": 1,
      "type": "integer"
    },
    "from_site_id": {
      "description": "Another environment of the same site.",
      "minimum": 1,
      "type": "integer"
    },
    "parts": {
      "items": {
        "enum": [
          "stages",
          "settings",
          "variables",
          "secrets",
          "options"
        ],
        "type": "string"
      },
      "maxItems": 5,
      "minItems": 1,
      "type": "array"
    },
    "revision": {
      "description": "This binding's pipeline revision you read.",
      "type": "string"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "from_site_id",
    "parts",
    "revision"
  ],
  "type": "object"
}
```

## Refusals

- `forbidden`: the person's role lacks the Edit Environment Deployment Pipeline permission (copying writes this site's
  pipeline). The message names it and says an owner of the company can grant it in Roles; `details.permission` is
  `editEnvironmentDeploymentPipeline`. Nothing is changed.
- `confirm`: the target is production; send `confirm_production: true` to copy onto it.
- `pipeline_classic`: the source or this binding is still a classic pipeline, so stages and settings cannot be copied.
- `stale`: the pipeline changed since you read it; read it again and resend.
- `pipeline_locked`: Corefinity has locked this pipeline.
- `variable_reserved`: a copied variable has a name this environment reserves.
- `variable_tool_credential`: a copied variable is named as a build tool's credential (`COMPOSER_AUTH`, `NPM_TOKEN`, …) and this environment does not have it yet: builds would see it as CF_<name>, so the tool would never read it. Nothing is copied; save the credentials under Private registries, or copy without `variables`.
- `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.
- 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_deployments_pipeline_copy",
  "arguments": {
    "site_id": 4212,
    "from_site_id": 4211,
    "parts": [
      "stages",
      "settings"
    ],
    "revision": "r-8f2c",
    "dry_run": true
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_deployments_pipeline_copy with site_id 4212, from_site_id 4211, parts ["stages","settings"], revision r-8f2c, dry_run true. (Copy a pipeline from another environment.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/deployments/pipeline/{binding}/copy](https://docs.corefinity.com/api/reference/deployments/copy-site-deployment-pipeline.md)
- Guide: [Pipeline](https://docs.corefinity.com/guides/sites/code-and-deployments/pipeline-stages.md)
