# IRPCServerAdmin.RestoreMasterDB

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/RestoreMasterDB/

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

Replaces the server's master database with a master database backup file on the server.

- **Service:** [Server administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/index.md) `MFiles.IRPCServerAdmin`
- **gRPC method:** `/MFiles.IRPCServerAdmin/RestoreMasterDB`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/restore-master-db`
- **Request:** [`RestoreMasterDBRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/RestoreMasterDB/index.md#request)
- **Response:** [`RestoreMasterDBResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/RestoreMasterDB/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

- Destructive: the current master database content is replaced by the backup.
- Requires the system administrator server role (server right `restore_master_database`).
- Fails if the file is not a master database backup.

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

## Request: RestoreMasterDBRequest

> 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 |
|---|---|---|
| `source_file` | `string` | Full path of the master database backup file on the server computer. |
| `utf8szimpersonation` | [`Impersonation`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Impersonation/index.md) | The account used to read the backup file. See [Impersonation](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Impersonation/index.md). |
| `utf8szimpersonation.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). |
| `utf8szimpersonation.account` | `string` | Account name (e.g. DOMAIN\user). |
| `utf8szimpersonation.encrypted_password` | `bytes` | Encrypted password. |

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

## Response: RestoreMasterDBResponse

No fields.
