PostgresDatabase

Backups

Manage and restore database backups in Prisma Postgres

Overview

On Starter, Pro, and Business plans, 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 to view your available backups and restore them.

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:

PlanSnapshot retention
StarterLast 7 days
ProLast 7 days
BusinessLast 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 and copy the missing rows back. Recover deleted records from a hosted Postgres database walks through the steps.

For more details about backup availability and plan-specific features, visit our pricing page.

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

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 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

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.

    Terminal
    npx prisma postgres list
    npx prisma postgres delete <database-id>
  • REST API: DELETE /v1/databases/{databaseId} deletes the database with that id. See 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

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. This is useful for migrating data between databases or creating a local copy of your database.

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

To create backups, ensure you have the PostgreSQL command-line tools installed. Run the following commands based on your operating system:

brew install postgresql@17
which pg_dump
which pg_restore

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

Get your direct connection string by following Connecting to your database.

You can now dump the database by running the following command and using your own connection string:

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.