---
title: "corestack_files_sync"
url: https://docs.corefinity.com/mcp/tools/corestack_files_sync
type: tool
last_updated: 2026-11-13
feature: files-and-transfers
related:
  - https://docs.corefinity.com/mcp/files-and-transfers.md
---
# corestack_files_sync

**Sync an archive into the site.** Unpack an uploaded archive (tar, tar.gz, tar.zst or zip; corestack_transfer_upload_create) into a path under the site root (htdocs, a path under it, or shared/…) as the site user. Everything is checked and staged before the site is touched; the platform's own files (wp-config.php, .env, app/etc/env.php, the WordPress loader) are never overwritten or deleted. delete_extraneous removes files the archive does not have, except paths an exclude matches. On a Git-mode site switch to manual deployment first (corestack_deployments_mode_set). Scope: write. Also needs destructive when it deletes files on production. Long-running: answers with a task.

- Scope: `write`
- Also needs `destructive` when `delete_extraneous` and the row is production
- Confirmation: `confirm_domain`
- Runs as a task: yes

## When to use it

Unpack an uploaded archive (tar, tar.gz, tar.zst or zip; corestack_transfer_upload_create) into a path under the site root (htdocs, a path under it, or shared/…) as the site user. Everything is checked and staged before the site is touched; the platform's own files (wp-config.php, .env, app/etc/env.php, the WordPress loader) are never overwritten or deleted. delete_extraneous removes files the archive does not have, except paths an exclude matches. On a Git-mode site switch to manual deployment first (corestack_deployments_mode_set).

## Inputs

- `site_id` (integer, ≥ 1, required)
- `transfer_id` (integer, ≥ 1, required)
- `target_path` (string, 1–1024 characters, required): Relative to the site root, e.g. htdocs.
- `delete_extraneous` (boolean, default `false`)
- `excludes` (array of string, 1–1024 characters, up to 100 items): rsync patterns: never written, never deleted.
- `strip_components` (integer, 0–5, default `0`)
- `confirm_domain` (string, up to 253 characters): The site's domain, typed exactly, to delete on production.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "confirm_domain": {
      "description": "The site's domain, typed exactly, to delete on production.",
      "maxLength": 253,
      "type": "string"
    },
    "delete_extraneous": {
      "default": false,
      "type": "boolean"
    },
    "excludes": {
      "description": "rsync patterns: never written, never deleted.",
      "items": {
        "maxLength": 1024,
        "minLength": 1,
        "type": "string"
      },
      "maxItems": 100,
      "type": "array"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    },
    "strip_components": {
      "default": 0,
      "maximum": 5,
      "minimum": 0,
      "type": "integer"
    },
    "target_path": {
      "description": "Relative to the site root, e.g. htdocs.",
      "maxLength": 1024,
      "minLength": 1,
      "type": "string"
    },
    "transfer_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "transfer_id",
    "target_path"
  ],
  "type": "object"
}
```

## Refusals

- `git_mode`: a files sync into the releases layout of a Git-mode row; switch the site to manual deployment first (`corestack_deployments_mode_set`).
- `archive_member_refused`: an archive member's name, type or link target is refused; `details` names the member; nothing written; repack without it.
- `archive_too_large`: the archive's entries or expanded bytes are over `mcp.files.max_entries` / `mcp.files.max_expanded_bytes`; split the archive.
- `format_unsupported`: the archive is not tar, tar.gz, tar.zst or zip, a zip uses zip64, encryption or a method other than stored / deflate, or the helper's PHP module would not load in the no-php.ini run — ended at its first step, nothing downloaded or written; repack it.
- `insufficient_space`: the row's disk cannot hold the files sync's expanded tree, or a `path` database export would take the volume's free space under `mcp.files.space_margin_bytes`; free space or raise the package.
- `transfer_changed`: the transfer's object is not the generation recorded for it, or yields more bytes than its scan did; nothing was written; upload again.
- `unsafe_link`: the destination holds a symlink the sync would write through that is not one of the row's shared-path links; `details` names it; nothing written; remove or replace the link, then call again.
- `transfer_cancelled`: a consuming run was stopped — or stopped itself at its last check before anything destructive — because the transfer it was using was cancelled, whichever grant ran it; an import's safety snapshot is its way back, a sync's stage is removed; upload the file again if it is still wanted.
- `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_files_sync",
  "arguments": {
    "site_id": 4211,
    "transfer_id": 2207,
    "target_path": "/var/www/example.co.uk/htdocs"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_files_sync with site_id 4211, transfer_id 2207, target_path /var/www/example.co.uk/htdocs. (Sync an archive into the site.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [Files and transfers](https://docs.corefinity.com/mcp/files-and-transfers.md)
