# IRPCVaultsAdmin.BackUpVault

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Vault management](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/BackUpVault/

Badges: `Administration API / specialized` `admin` `session`

Backs up a vault into a backup file on the server.

- **Service:** [Vault management](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/index.md) `MFiles.IRPCVaultsAdmin`
- **gRPC method:** `/MFiles.IRPCVaultsAdmin/BackUpVault`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/back-up-vault`
- **Request:** [`BackUpVaultRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/BackUpVault/index.md#request)
- **Response:** [`BackUpVaultResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/BackUpVault/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- **Starts a background job and returns before it completes**; follow it with `task_id` (see the
  service overview).
- Requires the system administrator server role (server right `backup_vaults`).
- The server writes the file: `target_file` is a path on the server machine, accessed with the
  account in `impersonation` (unset means `IMPERSONATION_TYPE_SYSTEM_ACCOUNT`). To back up the
  master database, use [BackUpMasterDB](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUpMasterDB/index.md).

<a id="request"></a>

## Request: BackUpVaultRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `backupjob` | [`BackupJob`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.BackupJob/index.md) | The backup to make: the vault (`vault_guid`), full or differential (`type`), the target file on the server and whether to overwrite it. |
| `backupjob.vault_guid` | `string` | The GUID of the vault, or GUID_NULL if defining a backup of the master database. |
| `backupjob.type` | [`BackupType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.BackupType/index.md) | Backup type (e.g. full or differential). Values: `BACKUP_TYPE_FULL` (0), `BACKUP_TYPE_DIFFERENTIAL` (1). |
| `backupjob.target_file` | `string` | Full path to the target file on server. |
| `backupjob.impersonation` | [`Impersonation`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Impersonation/index.md) | Impersonation information for accessing the backup target file on server. |
| `backupjob.impersonation.type` | [`ImpersonationType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ImpersonationType/index.md) | Impersonation type. Values: `IMPERSONATION_TYPE_SYSTEM_ACCOUNT` (0), `IMPERSONATION_TYPE_LOCAL_WINDOWS_ACCOUNT` (1), `IMPERSONATION_TYPE_EXTERNAL_ACCOUNT` (2). |
| `backupjob.impersonation.account` | `string` | Account name (e.g. DOMAIN\user). |
| `backupjob.impersonation.encrypted_password` | `bytes` | Encrypted password. |
| `backupjob.overwrite_existing_files` | `bool` | If true, existing target files are overwritten. If false, backup fails if a target file already exists. |
| `backupjob.file_size_limit_in_mb` | `uint32` | Maximum size of one backup file in megabytes. If exceeded, backup will continue in a new sequentially numbered file. If zero, file size is unlimited and the backup will always consist of a single file only. |

<a id="response"></a>

## Response: BackUpVaultResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `task_id` | `int32` | The ID of the server-level scheduled job that makes the backup. Pass it to [GetScheduledJobRunInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/GetScheduledJobRunInfo/index.md). |

<a id="related"></a>

## Related methods

- [IRPCServerAdmin.BackUpMasterDB](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUpMasterDB/index.md): Backs up the server's master database to a file on the server, and returns when the backup is complete.
