---
title: "corestack_db_export"
url: https://docs.corefinity.com/mcp/tools/corestack_db_export
type: tool
last_updated: 2026-11-13
feature: database
related:
  - https://docs.corefinity.com/guides/sites/database/database-users.md
---
# corestack_db_export

**Export the database.** Dump the environment's database (routines, triggers and events included) into a transfer you can download (default) or a file under the site root outside the document root. exclude_tables leaves those tables' rows out but keeps their structure. The export is complete or it fails: nothing partial is kept. Scope: exec. Long-running: answers with a task.

- Scope: `exec`
- Runs as a task: yes

## When to use it

Dump the environment's database (routines, triggers and events included) into a transfer you can download (default) or a file under the site root outside the document root. exclude_tables leaves those tables' rows out but keeps their structure. The export is complete or it fails: nothing partial is kept.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `target` (one of `transfer`, `path`, default `"transfer"`)
- `path` (string, up to 1024 characters): With target path: relative to the site root, outside the document root.
- `exclude_tables` (array of string, 1–64 characters, up to 500 items)
- `compression` (one of `zstd`, `gzip`, `none`, default `"zstd"`)
- `anonymise` (boolean, default `false`): Shopware only: shopware-cli's anonymised dump (cart data left out).

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "anonymise": {
      "default": false,
      "description": "An anonymised dump (cart data left out), on a platform that offers one.",
      "type": "boolean"
    },
    "compression": {
      "default": "zstd",
      "enum": [
        "zstd",
        "gzip",
        "none"
      ],
      "type": "string"
    },
    "exclude_tables": {
      "items": {
        "maxLength": 64,
        "minLength": 1,
        "type": "string"
      },
      "maxItems": 500,
      "type": "array"
    },
    "path": {
      "description": "With target path: relative to the site root, outside the document root.",
      "maxLength": 1024,
      "type": "string"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    },
    "target": {
      "default": "transfer",
      "enum": [
        "transfer",
        "path"
      ],
      "type": "string"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- `path_public`: a database export's `path` lies inside the document root, where it would be served; choose a path outside the document root, or the transfer target.
- `dump_incomplete`: a database export's `mariadb-dump` pass failed or ended without its own `-- Dump completed` trailer (`set -o pipefail`); no `path` file renamed into place and no transfer object finalised; call again; read the run's stderr.
- `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.
- `quota_exceeded`: an upload over `mcp.transfers.max_object_bytes`, or over the company's or the row's live-transfer quota; split the upload, or wait for older transfers to expire.
- `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_db_export",
  "arguments": {
    "site_id": 4211,
    "target": "transfer",
    "compression": "zstd"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_db_export with site_id 4211, target transfer, compression zstd. (Export the database.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [Database users](https://docs.corefinity.com/guides/sites/database/database-users.md)
