# IRPCServerAdmin.BackUp

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) > [Server administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/index.md)

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

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

Starts a backup of a vault or of the master database as a server job and returns the job ID.

- **Service:** [Server administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/index.md) `MFiles.IRPCServerAdmin`
- **gRPC method:** `/MFiles.IRPCServerAdmin/BackUp`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/back-up`
- **Request:** [`BackUpRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUp/index.md#request)
- **Response:** [`BackUpResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUp/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. The ID is a scheduled job ID: follow
  it with [GetScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/GetScheduledJob/index.md), cancel it with
  [CancelScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/CancelScheduledJob/index.md), and remove the
  job with [RemoveScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/RemoveScheduledJob/index.md) when it
  has finished (M-Files Admin does this).
- Requires the system administrator server role: server right `backup_vaults` for a vault,
  `backup_master_database` when `backupjob.vault_guid` is the null GUID.
- For a vault, the call first waits for the vault to finish any ongoing online/offline change.

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

## Request: BackUpRequest

> 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) | What to back up and where. Set `vault_guid` to the vault, or to `{00000000-0000-0000-0000-000000000000}` for the master database. See [BackupJob](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.BackupJob/index.md). |
| `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: BackUpResponse

> 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 scheduled job that runs the backup. |

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

## Related methods

- [IRPCScheduledJobsAdmin.GetScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/GetScheduledJob/index.md): Gets one scheduled job and its run state.
- [IRPCScheduledJobsAdmin.CancelScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/CancelScheduledJob/index.md): Asks a running scheduled job to stop.
- [IRPCScheduledJobsAdmin.RemoveScheduledJob](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/RemoveScheduledJob/index.md): Removes a scheduled job.
- [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.
