- [HTTP request](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#body.request_body)
- [Response body](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#body.aspect)
- [InstancesRestoreBackupRequest](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#InstancesRestoreBackupRequest)
  - [JSON representation](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#InstancesRestoreBackupRequest.SCHEMA_REPRESENTATION)
- [RestoreBackupContext](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#RestoreBackupContext)
  - [JSON representation](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#RestoreBackupContext.SCHEMA_REPRESENTATION)
- [Examples](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#examples)
- [Try it!](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#try-it)

Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.

### HTTP request

`POST https://sqladmin.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `project` | `string` Project ID of the project that contains the instance. |
| `instance` | `string` Cloud SQL instance ID. This does not include the project ID. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#InstancesRestoreBackupRequest`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloudsql`
- `
  https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/sqlservice.admin`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## InstancesRestoreBackupRequest

Database instance restore backup request.

| JSON representation |
|---|
| ``` { "restoreBackupContext": { object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#RestoreBackupContext`) }, "backup": string, "backupdrBackup": string, "restoreInstanceSettings": { object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances#DatabaseInstance`) }, "restoreInstanceClearOverridesFieldNames": [ string ] } ``` |

| Fields ||
|---|---|
| `restoreBackupContext` | ``object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances/restoreBackup#RestoreBackupContext`)`` Parameters required to perform the restore backup operation. |
| `backup` | `string` The name of the backup that's used to restore a Cloud SQL instance: Format: projects/{project-id}/backups/{backup-uid}. Only one of restoreBackupContext, backup, backupdrBackup can be passed to the input. |
| `backupdrBackup` | `string` The name of the backup that's used to restore a Cloud SQL instance: Format: "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}". Only one of restoreBackupContext, backup, backupdrBackup can be passed to the input. |
| `restoreInstanceSettings` | ``object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1beta4/instances#DatabaseInstance`)`` Optional. By using this parameter, Cloud SQL overrides any instance settings stored in the backup you are restoring from. You can't change the instance's major database version and you can only increase the disk size. You can use this field to restore new instances only. This field is not applicable for restore to existing instances. |
| `restoreInstanceClearOverridesFieldNames[]` | `string` Optional. This field has the same purpose as restoreInstanceSettings, changes any instance settings stored in the backup you are restoring from. With the difference that these fields are cleared in the settings. |

## RestoreBackupContext

Database instance restore from backup context. Backup context contains source instance id and project id.

| JSON representation |
|---|
| ``` { "kind": string, "backupRunId": string, "instanceId": string, "project": string } ``` |

| Fields ||
|---|---|
| `kind` | `string` This is always `sql#restoreBackupContext`. |
| `backupRunId` | `string (https://developers.google.com/discovery/v1/type-format format)` The ID of the backup run to restore from. |
| `instanceId` | `string` The ID of the instance that the backup was taken from. |
| `project` | `string` The full project ID of the source instance. |