Restore a Prisma Postgres database as it was before a bad migration or delete
Prisma Postgres can now restore a database as it was at a time you choose, up to 7 days back on the Pro plan and up to 30 days back on the Business and Enterprise plans. A restore always creates a new database, so your app keeps using the original while you copy back the rows you need.
Get back the rows a migration or a bad query removed
Until now, a Prisma Postgres restore went back to a daily backup, so anything written between that backup and the mistake was lost. With point-in-time recovery you choose the time instead. If a migration deleted a column at 14:05, you restore the database as it was at 14:04, then copy the data you need back into the original. The new database is created in the same project, on the same branch and in the same region, and it has its own connection strings, so nothing changes for the original database or the app that uses it.
The newest time you can choose is 10 minutes ago. The oldest is the earliest backup your database still has, so the window is shorter than 7 or 30 days for a database that is only a few days old. On the Starter plan, daily backups are kept for 7 days and restore to the time the backup was taken, not to a time you choose. The Free plan has no backups.
To restore in the Console, open the database, select Point in time in the sidebar, choose the date and time and a name for the new database, and click Restore to new database. A large database can take several hours to restore, and Prisma emails the project's Admins and Developers when it finishes. The REST API and the Prisma MCP server use the same window: GET /v1/databases/{databaseId}/backups/pitr returns the oldest and newest times you can choose, and POST /v1/projects/{projectId}/databases with a pitr source and a targetTime starts the restore. An agent connected to the Prisma MCP server does the same with the get_prisma_postgres_pitr_window and create_prisma_postgres_recovery tools.
Need help applying these changes in production? Prisma Enterprise Support can help with schema design, performance, security, and compliance.