# Restore database (destructive) (/docs/management-api/endpoints/databases/post-databases-by-target-database-id-restore)

Location: Management API > Endpoints > Databases > Restore database (destructive)

⚠️ **Destructive operation** — this immediately and irreversibly overwrites all data in the target database with the contents of the specified backup. Any data written since the backup was taken will be lost. Ensure you have a recent backup of the target database before proceeding.

Replaces the data in an existing database from a backup. Connections and credentials are preserved — only the data layer is replaced.

## API reference

### Restore database (destructive)

`POST /v1/databases/{targetDatabaseId}/restore`

⚠️ **Destructive operation** — this immediately and irreversibly overwrites all data in the target database with the contents of the specified backup. Any data written since the backup was taken will be lost. Ensure you have a recent backup of the target database before proceeding. Replaces the data in an existing database from a backup. Connections and credentials are preserved — only the data layer is replaced.

#### Parameters

- `targetDatabaseId` (path, string, required)

#### Request body

- `source` (object, required)

#### Responses

- `200`: Database restore initiated. The database status will be "recovering" until the restore completes.
- `401`: Missing or invalid authorization token.
- `404`: Target database, source database, or backup not found.
- `409`: Target database is currently provisioning or recovering and cannot be restored.
- `422`: Invalid source type or backup not usable.

## Related pages

- [`Create database`](https://www.prisma.io/docs/management-api/endpoints/databases/post-databases): Creates a new database in the specified project.
- [`Create database`](https://www.prisma.io/docs/management-api/endpoints/databases/post-projects-by-project-id-databases): Creates a new database for the given project.
- [`Delete database`](https://www.prisma.io/docs/management-api/endpoints/databases/delete-databases-by-database-id): Deletes the database with the given ID.
- [`Get database`](https://www.prisma.io/docs/management-api/endpoints/databases/get-databases-by-database-id): Returns the database with the given ID.
- [`Get list of databases`](https://www.prisma.io/docs/management-api/endpoints/databases/get-projects-by-project-id-databases): Returns databases for the given project.