---
title: "ezgh databases restore"
description: "Restore a backup or a point in time into a new database."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh databases restore

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh databases restore <name> (--from-backup b | --from-database d --time t) --instance-type t --subnet s --storage-size-gib n [flags] [--wait]
```

Restore into a new database: a backup (`--from-backup` dbb\_…), or a database as it was at a time in its restorable ranges (`--from-database` with `--time`, RFC 3339; `ezgh databases get` shows the ranges). The source fixes the engine and version, and the storage is at least the source's. It takes minutes: `--wait` waits until it's available and prints it.

Part of [`ezgh databases`](/cli/reference/databases).

## Examples

```sh
ezgh databases restore orders-copy --from-database orders --time 2026-11-02T09:30:00Z \
  --instance-type gp-1.large --subnet sbn_2m9x0a7qpe4k --storage-size-gib 100 --wait
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--allowed-source-cidr` | string, repeatable |  | an IPv4 CIDR that may connect; repeat for more, at most 20 (default the VPC's ranges) |
| `--backup-retention-days` | int |  | days automated backups are kept, 1 to 35 (default 7) |
| `--backup-window` | string |  | when the daily backup is taken, HH:MM-HH:MM UTC, at least 30 minutes |
| `--deletion-protection` | boolean |  | refuse deletes until it's turned off |
| `--description` | string |  | what it's for |
| `--from-backup` | string |  | the backup to restore (dbb\_…) |
| `--from-database` | string |  | the database to restore, with `--time` |
| `--instance-type` | string |  | a gp-1 or gs-1 instance type, from ezgh compute instance-types list |
| `--log-export` | string, repeatable |  | send these logs to Obs: error, slow or audit; repeat for more |
| `--maintenance-window` | string |  | when maintenance happens, ddd:HH:MM-ddd:HH:MM UTC, at least 30 minutes |
| `--parameter` | string, repeatable |  | an engine parameter, name=value; repeat for more; names from ezgh databases engine-versions -o json |
| `--storage-iops` | int |  | its storage's IOPS (default the volume type's) |
| `--storage-size-gib` | int |  | its storage, in GiB |
| `--storage-throughput` | int |  | its storage's throughput, in MB/s (default the volume type's) |
| `--subnet` | string |  | the subnet it's in (sbn\_…), with at least 16 free addresses |
| `--tag` | string, repeatable |  | a tag, key=value; repeat for more |
| `--time` | string |  | the time to restore it to, RFC 3339 |
| `--volume-type` | string |  | its storage's volume type (default gp1) |
| `--wait` | boolean |  | wait until it's available, and print it then |
| `--wait-timeout` | duration | `10m0s` | how long `--wait` waits |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/databases-restore/index.mdx
