Accidental Seeding of Production Database
I accidentally ran my seed command from the development environment and it overwrote my production database (connected via Vercel) with local data.
Is there any way to restore or recover the previous state of the database?
I’d really appreciate guidance on whether Prisma (or the underlying provider) keeps automatic backups or snapshots that I can revert to. Prisma dashboard shows no backups
2 Replies
You opted for speed from this bot. Let's conjure up an answer right now!
I'm sorry to hear about the accidental seeding of your production database.
Prisma Postgres Backups:
If you are using Prisma Postgres (the managed database service from Prisma), automatic daily snapshots are created on Pro and Business plans, but only on days with database activity. You can view and restore these backups from the Backups tab in the Prisma Console. The retention period depends on your plan (7 days for Pro, 30 days for Business). However, if the Prisma dashboard shows no backups, it may mean you are on a plan or setup that does not include this feature, or there was no activity to trigger a snapshot on the relevant day. Please note that any changes after the most recent snapshot will not be restored if you roll back to it. For more details, see the Prisma docs on backups and blog announcement. Vercel Postgres:
If you are using Vercel Postgres (not Prisma Postgres), Prisma itself does not manage or provide backups for your database. In this case, you need to check Vercel’s database dashboard or documentation to see if they offer backup or restore options. Prisma does not keep its own backup copies of your data for external databases. Manual Backups:
For future safety, consider regularly creating manual backups using
- If you use Prisma Postgres and see backups in the Console, you can restore from there. - If you use Vercel Postgres or another provider, check their dashboard for backup/restore options. - Prisma does not keep automatic backups for external databases. If you need more specific help, please clarify which database provider you are using.
If you are using Prisma Postgres (the managed database service from Prisma), automatic daily snapshots are created on Pro and Business plans, but only on days with database activity. You can view and restore these backups from the Backups tab in the Prisma Console. The retention period depends on your plan (7 days for Pro, 30 days for Business). However, if the Prisma dashboard shows no backups, it may mean you are on a plan or setup that does not include this feature, or there was no activity to trigger a snapshot on the relevant day. Please note that any changes after the most recent snapshot will not be restored if you roll back to it. For more details, see the Prisma docs on backups and blog announcement. Vercel Postgres:
If you are using Vercel Postgres (not Prisma Postgres), Prisma itself does not manage or provide backups for your database. In this case, you need to check Vercel’s database dashboard or documentation to see if they offer backup or restore options. Prisma does not keep its own backup copies of your data for external databases. Manual Backups:
For future safety, consider regularly creating manual backups using
pg_dump or your provider’s backup tools. Prisma recommends using the database provider’s backup/restore features for disaster recovery, as Prisma does not handle this for external databases source.
Summary:- If you use Prisma Postgres and see backups in the Console, you can restore from there. - If you use Vercel Postgres or another provider, check their dashboard for backup/restore options. - Prisma does not keep automatic backups for external databases. If you need more specific help, please clarify which database provider you are using.
Hi @Fahad Hassan!
You should be able to restore your database from one of the autonated backups once you upgrade to Pro plan.
Backups are taken for all plans. Access to Backup is on Pro plan and above.