# BackupJob

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

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

Struct for a backup job.

- **Full name:** `MFiles.BackupJob`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-vault_guid"></a>`vault_guid` | `string` | 1 | The GUID of the vault, or GUID_NULL if defining a backup of the master database. |
| <a id="f-type"></a>`type` | [`BackupType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.BackupType/index.md) | 2 | Backup type (e.g. full or differential). Values: `BACKUP_TYPE_FULL` (0), `BACKUP_TYPE_DIFFERENTIAL` (1). |
| <a id="f-target_file"></a>`target_file` | `string` | 3 | Full path to the target file on server. |
| <a id="f-impersonation"></a>`impersonation` | [`Impersonation`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Impersonation/index.md) | 4 | Impersonation information for accessing the backup target file on server. |
| <a id="f-overwrite_existing_files"></a>`overwrite_existing_files` | `bool` | 5 | If true, existing target files are overwritten. If false, backup fails if a target file already exists. |
| <a id="f-file_size_limit_in_mb"></a>`file_size_limit_in_mb` | `uint32` | 6 | 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="used-by-methods"></a>

## Used by methods

- [IRPCServerAdmin.BackUp](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUp/index.md): Starts a backup of a vault or of the master database as a server job and returns the job ID.
- [IRPCVaultsAdmin.BackUpVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/BackUpVault/index.md): Backs up a vault into a backup file on the server.

<a id="used-in-fields"></a>

## Used in fields

- [`JobDataUnion.backup`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.JobDataUnion/index.md#f-backup): Backup job.
- [`BackUpRequest.backupjob`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUp/index.md#request): 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).
- [`BackUpVaultRequest.backupjob`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/BackUpVault/index.md#request): The backup to make: the vault (`vault_guid`), full or differential (`type`), the target file on the server and whether to overwrite it.
