# Backups (/docs/postgres/database/backups) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Manage and restore database backups in Prisma Postgres Location: Postgres > Database > Backups ## Overview [#overview] On [Starter, Pro, and Business plans](https://www.prisma.io/pricing), Prisma Postgres automatically creates snapshots of your database to support recovery and backup workflows. Navigate to the **Backups** tab of your Prisma Postgres instance in the [Prisma Console](https://console.prisma.io/?utm_source=docs\&utm_medium=content\&utm_content=postgres) to view your available backups and [restore them](#restoring-a-backup). Snapshots are created *daily*, but only on days when the database has activity. Depending on your plan, you will see a different number of available snapshots: | Plan | Snapshot retention | | -------- | ------------------ | | Starter | Last 7 days | | Pro | Last 7 days | | Business | Last 30 days | Database changes or events that occurred after the most recent snapshot may not be restored. To recover rows that were deleted by mistake without overwriting newer data, [restore a snapshot to a new database](#restoring-a-backup) and copy the missing rows back. [Recover deleted records from a hosted Postgres database](https://www.prisma.io/postgres/recover-deleted-records) walks through the steps. For more details about backup availability and plan-specific features, visit our [pricing page](https://www.prisma.io/pricing). > [!NOTE] > Point-in-time recovery is coming to Prisma Postgres in November 2026. It will restore a database to a moment you choose, rather than to a retained daily snapshot. ## Restoring a backup [#restoring-a-backup] In the **Backups** tab, select **Restore backup** next to a completed backup and choose where the backup goes: * **Restore to a new database** creates a new database from the backup in the same project and leaves the original database as it is. The original database's connection strings don't reach the new database, so [generate a connection string](https://www.prisma.io/docs/postgres/database/connecting-to-your-database#get-your-connection-strings) for it and point your app at that, or copy the rows you need back into the original database. * **Restore to an existing database**, with the database you are restoring selected as the target, rolls that database back to the backup in place. All of its data is overwritten with the backup, and anything written after the backup was taken is lost. Open connections are closed while the restore runs. The database keeps its connection strings, so your app can use the same `DATABASE_URL` once the restore completes. Restoring a backup into a different database that already exists is not supported. Restore it to a new database instead. If the database is connected to Vercel through the integration, restore it in place so the connection strings in your Vercel project keep working. ### Deleting a restored copy in a Vercel workspace [#deleting-a-restored-copy-in-a-vercel-workspace] In a workspace created through the Vercel integration, a database you create with **Restore to a new database** doesn't appear in your Vercel dashboard. You can't delete it from the Console either: the Console shows "This database is managed through your Vercel account" and a **Manage in Vercel** button for it, as it does for every database in that workspace. To delete the copy, use the Prisma CLI or the REST API: * **CLI**: sign in with `npx prisma auth login`. Find the copy's id with `npx prisma postgres list`, then delete it. The CLI asks you to enter the exact id to confirm. #### bun ```bash title="Terminal" bunx prisma postgres list bunx prisma postgres delete ``` #### pnpm ```bash title="Terminal" pnpm prisma postgres list pnpm prisma postgres delete ``` #### yarn ```bash title="Terminal" yarn prisma postgres list yarn prisma postgres delete ``` #### npm ```bash title="Terminal" npx prisma postgres list npx prisma postgres delete ``` * **REST API**: [`DELETE /v1/databases/{databaseId}`](https://www.prisma.io/docs/rest-api/endpoints/databases/delete-databases-by-database-id) deletes the database with that id. See [REST API](https://www.prisma.io/docs/rest-api) for the base URL and how to authenticate. The CLI and the REST API refuse to delete a Prisma project's default database, which is the original database the integration created, so you can't delete it this way by mistake. ### Restoring with the REST API, CLI, or MCP server [#restoring-with-the-rest-api-cli-or-mcp-server] * [`POST /v1/databases/{targetDatabaseId}/restore`](https://www.prisma.io/docs/rest-api/endpoints/databases/post-databases-by-target-database-id-restore) and [`prisma postgres backup restore `](https://www.prisma.io/docs/cli/postgres) restore in place, like **Restore to an existing database**. * [`POST /v1/projects/{projectId}/databases`](https://www.prisma.io/docs/rest-api/endpoints/databases/post-projects-by-project-id-databases) with a `source` of type `backup` creates a new database from a backup. The response includes the new database's connection string. * The `create_prisma_postgres_recovery` [MCP tool](https://www.prisma.io/docs/ai/mcp-tools) restores a backup into a new database. ## Manually creating a backup file via `pg_dump` [#manually-creating-a-backup-file-via-pg_dump] If you would like to create a backup file of your database, you can use `pg_dump` with a [direct connection](https://www.prisma.io/docs/postgres/database/connecting-to-your-database). This is useful for migrating data between databases or creating a local copy of your database. ## Prerequisites [#prerequisites] Before you begin, make sure you have: * **Node.js** installed (version 16 or higher). * **PostgreSQL CLI Tools** (`pg_dump`) for creating backups. Use Postgres version 17 as Prisma Postgres is based on this version. * A **direct connection string** for your Prisma Postgres database. ## 1. Install PostgreSQL command-line tools [#1-install-postgresql-command-line-tools] To create backups, ensure you have the PostgreSQL command-line tools installed. Run the following commands based on your operating system: #### macOS ```bash brew install postgresql@17 which pg_dump which pg_restore ``` #### Windows ```bash # Download from the official PostgreSQL website: # https://www.postgresql.org/download/windows/ # During installation, select "Command Line Tools". # Then verify with: where pg_dump where pg_restore ``` #### Linux ```bash sudo apt-get update sudo apt-get install postgresql-client-17 which pg_dump which pg_restore ``` > [!NOTE] > If you installed PostgreSQL but still see a "command not found" error for `pg_dump` or `pg_restore`, ensure your installation directory is in your system's `PATH` environment variable. ### 2. Creating the Backup with `pg_dump` [#2-creating-the-backup-with-pg_dump] Get your direct connection string by following [Connecting to your database](https://www.prisma.io/docs/postgres/database/connecting-to-your-database). You can now dump the database by running the following command and using your own connection string: ```bash pg_dump --dbname="postgres://USER:PASSWORD@db.prisma.io:5432/?sslmode=require" > ./mydatabase.bak ``` This will create your backup file named `mydatabase.bak` in the current directory. ## Related pages - [`Connect to Prisma Postgres without Accelerate`](https://www.prisma.io/docs/postgres/database/switch-from-accelerate): Replace a hosted Prisma Postgres Accelerate connection without moving your database or data - [`Connecting to your database`](https://www.prisma.io/docs/postgres/database/connecting-to-your-database): Choose the right Prisma Postgres connection string for your runtime, tool, and workload. - [`Connection pooling`](https://www.prisma.io/docs/postgres/database/connection-pooling): Use Prisma Postgres connection pooling for concurrent application traffic. - [`Extensions`](https://www.prisma.io/docs/postgres/database/postgres-extensions): Enable and use standard PostgreSQL extensions with Prisma Postgres. - [`Query Insights`](https://www.prisma.io/docs/postgres/database/query-insights): Inspect slow queries, connect Prisma calls to SQL, and apply focused fixes with Prisma Postgres.