# dflow db:restore

> Restore a PostgreSQL, MySQL, or Redis backup into a new service. The source stays as it is.

Web page: /docs/cli/data/db-restore/

This restores a PostgreSQL, MySQL, or Redis backup into a new database. The source database stays as it is. Point-in-time restore is on for those three. Pass `--backup` or `--time`, not both, and confirm the source name. `Confirm-Name` is that source name. Read the new password with `dflow db:credentials`. MongoDB backups are not available. The command returns that backups are not available.

```bash
dflow db:restore SOURCE --name NEW --backup ID
dflow db:restore SOURCE --name NEW --time 2026-11-17T12:00:00Z --confirm-name SOURCE
```

## Flags

`--name` is the new database and is required. Pass `--backup` with an id from [`dflow db:backups:list`](/docs/cli/data/db-backups-list), or `--time` as an RFC3339 instant. Do not pass both. `--confirm-name` is the source name. When it is omitted, the command asks you to type that name. `--wait` defaults to true. `--wait-timeout` defaults to 5m.

## What you see

The source database is not replaced. The command waits for the new database unless `--wait=false`. Read the new password with [`dflow db:credentials`](/docs/cli/data/db-credentials).

## When it fails

A typed name that does not match the source exits 1. A source that is not ready, or that sits on a platform with no backups configured, exits 6. MongoDB returns that backups are not available. An unknown backup exits 3.
