# Dump database of a web hosting package into a file

> Write all data of one database into an SQL file in the web directory of its package.

- Effect: Write - Changes the account. Agents ask first.
- Idempotent: no
- Stability: beta
- MCP tool: `manitu_webhosting_web_database_dump` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/webhosting/web/database/dump`
- Needs: `service_webhosting`
- Page: /reference/webhosting/web/database/dump/

**Changes the account. Agents say what will happen and wait for an explicit yes before calling it.**

## MCP tool

`manitu_webhosting_web_database_dump`

### Description for the model

Writes all data of a database of a web hosting package of the manitu customer account this connection works in, by site_id and database_id from manitu_webhosting_web_database_list, into an SQL file (gzip unless compressed is false) in the web directory of the package - above htdocs, not reachable from the web; the answer names the file. The customer downloads it by FTP or SSH and should delete it afterwards, since it holds all data and counts against the disk space. Refused with a conflict when manitu does not know the password (password_not_stored - a new one with manitu_webhosting_web_database_set first), the package is almost out of disk space (quota_almost_exceeded) or cannot be changed now (not_configurable). Ask the customer for an explicit yes first.

### Arguments

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `database_id` (integer | string, required) - The database_id from manitu_webhosting_web_database_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `compressed` (boolean) - gzip-compressed (.sql.gz). Default: true.

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_webhosting_web_database_dump",
    "arguments": {
      "site_id": 12345,
      "database_id": 12345
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/webhosting/web/database/dump`

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `database_id` (integer | string, required) - The database_id from manitu_webhosting_web_database_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `compressed` (boolean) - gzip-compressed (.sql.gz). Default: true.

### Response

In `data`; the rest of the body as on every call.

- `database_id` (integer, required) - The database dumped.
- `file_name` (string, required) - The file written, in the web directory of the package (above htdocs).

### Statuses

- `200` Success.
- `400` The request does not match the declared input schema.
- `401` No credential was presented, or it was not recognised.
- `403` The credential is not permitted to use this operation.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST 'https://api.manitu.de/v1/webhosting/web/database/dump' \
  -H 'X-API-Key: $API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"site_id":12345,"database_id":12345}'
```

## Example result

```json
{
  "database_id": 12345,
  "file_name": "string"
}
```
