# Vault

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.Vault/

Struct for a document vault.

- **Full name:** `MFiles.Vault`
- **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"></a>`vault` | [`VaultBasic`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VaultBasic/index.md) | 1 | Basic data. |
| <a id="f-main_data_folder"></a>`main_data_folder` | `string` | 2 | The main physical folder of this vault on the server (e.g. C:\Program Files\M-Files\Server Vaults\MyVault). |
| <a id="f-additional_data_folders"></a>`additional_data_folders` | repeated [`AdditionalFolder`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AdditionalFolder/index.md) | 3 | The specification of the additional file data folders. |
| <a id="f-database_info"></a>`database_info` | [`SQLDatabase`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SQLDatabase/index.md) | 4 | The vault's SQL database. |
| <a id="f-file_data_storage"></a>`file_data_storage` | [`FileDataStorage`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileDataStorage/index.md) | 5 | Identifies file data storage to use. Typically specifies that the file data storage is determined automatically. Values: `FILE_DATA_STORAGE_DEFAULT` (0), `FILE_DATA_STORAGE_DISK` (1), `FILE_DATA_STORAGE_DATABASE` (2), `FILE_DATA_STORAGE_EXTERNAL` (3), `FILE_DATA_STORAGE_MASTER` (4). |
| <a id="f-file_data_connection_string"></a>`file_data_connection_string` | `string` | 6 | The connection string that identifies the location, protocol, and credentials for the file data storage of this vault. For example, this might specify a storage account, a protocol, and a container name for Azure's BLOB Services. Can be unset or empty. |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCVaultsAdmin.AttachExistingVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/AttachExistingVault/index.md): Attaches an existing vault (metadata database and file data files) to the server.
- [IRPCVaultsAdmin.AttachVaultToOneDbTest](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/AttachVaultToOneDbTest/index.md): Checks whether existing vault files can be attached on a server that has joined a subscription, without attaching them.
- [IRPCVaultsAdmin.CreateNewGroundLinkProxy](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/CreateNewGroundLinkProxy/index.md): Creates a ground link proxy, a vault of type `VAULT_TYPE_GROUND_LINK_PROXY`.
- [IRPCVaultsAdmin.CreateNewVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/CreateNewVault/index.md): Creates a new document vault.
- [IRPCVaultsAdmin.UpdateVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/UpdateVault/index.md): Changes the definition of a vault: name and other registration data, data folders, database, file data storage and vault variables.
- [IRPCVaultsAdminBasic.GetVaultAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdminBasic/GetVaultAdmin/index.md): Gets one ordinary vault with its administrative details.
- [IRPCVaultsAdminBasic.GetVaultsAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdminBasic/GetVaultsAdmin/index.md): Lists the ordinary vaults of the server (not replicas or Ground Link proxies) with their administrative details, including offline vaults.

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

## Used in fields

- [`CopyVaultJob.target_vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.CopyVaultJob/index.md#f-target_vault): The definition of the target vault. The GUID field is ignored. The server will generate a new GUID for the new vault.
- [`CopyVaultJobOutputInfo.new_vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.CopyVaultJobOutputInfo/index.md#f-new_vault): Receives the full definition of the new vault.
- [`MigrateVaultJob.target_vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.MigrateVaultJob/index.md#f-target_vault): The vault to migrate. Holds information on the target database engine, for example.
- [`RestoreJob.target_vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.RestoreJob/index.md#f-target_vault): The definition of the vault. If the GUID field is GUID_NULL, the restored vault uses the GUID specified in the backup files. Otherwise, it uses the given GUID (= restore to a different identity).
- [`RestoreJobOutputInfo.restored_vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.RestoreJobOutputInfo/index.md#f-restored_vault): Receives the full definition of the restored vault.
- [`VaultEx.vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VaultEx/index.md#f-vault): Basic data.
- [`AttachVaultToOneDbTestRequest.vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/AttachVaultToOneDbTest/index.md#request): The vault files to check: data folders and database, as for [AttachExistingVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/AttachExistingVault/index.md).
- [`CreateNewVaultRequest.vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/CreateNewVault/index.md#request): The definition of the new vault: name (`vault.vault.display_name`), data folder (`vault.main_data_folder`), database (`vault.database_info`) and file data storage. `vault.vault.guid` is ignored: the server generates a new GUID.
- [`CreateNewVaultResponse.new_vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/CreateNewVault/index.md#response): The full definition of the new vault, including its new GUID.
- [`UpdateVaultRequest.vault_info`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/UpdateVault/index.md#request): The new definition. A `vault_info.vault.guid` different from `guid` changes the vault's GUID. An empty `vault_info.database_info.database_name` leaves the database settings unchanged.
- [`CreateNewGroundLinkProxyResponse.new_vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/CreateNewGroundLinkProxy/index.md#response): Receives the full definition of the new vault.
- [`AttachExistingVaultRequest.vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/AttachExistingVault/index.md#request): Where the vault's files are: data folders and database. If `vault.vault.guid` is the null GUID, the vault keeps the GUID stored in its files; otherwise its GUID is changed to the given one.
- [`AttachExistingVaultResponse.attached_vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/AttachExistingVault/index.md#response): Receives the full definition of the attached vault.
- [`GetVaultsAdminResponse.vaults`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdminBasic/GetVaultsAdmin/index.md#response): The vaults. With `can_manage_vaults` all fields are filled except database credentials; otherwise only the basic data (`vault`: GUID, name, host names). See [Vault](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Vault/index.md).
- [`GetVaultAdminResponse.vault`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdminBasic/GetVaultAdmin/index.md#response): The vault. The fields filled depend on the caller (see the remarks). See [Vault](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Vault/index.md).
