All the data in my database has been deleted.
All the data in my database has been deleted. How to recover or the cause of the problem, I have used the free version Prisma Postgresql
Thanks
10 Replies
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into
#ask-ai
for a quick spin!all sequences are set current value = 1
Do you mean the data was accidentally deleted?
You can upgrade your plan to Pro/Business plan and get access to one of your automated backups and restore your database from the snapshot.
I am using community plan. If I upgrade to pro plan now, can I get access old backups before deleting accident?
@Nurul (Prisma) can you explain more
Hello @PhucPham ,
Even if you upgrade right now to a Pro (or higher) plan, unfortunately you won’t be able to access past backups, since those are only created under a paid plan. Snapshots start being generated only after the upgrade is active, so future data will be protected, but previous data cannot be recovered.
For the future, I strongly recommend setting up your own local backups alongside the database service. A simple way is to schedule regular
pg_dump
exports of your Prisma Postgres database and store them safely (for example in a Git-ignored backups/
folder, on cloud storage, or even automated via a cron job). This way, even on the free Community plan, you’ll always have a fallback copy of your data that you can restore quickly if something unexpected happens.
That said, keep in mind that this free approach works well for small databases but does add an extra layer of setup and maintenance compared to the automated backups you get on a paid plan.The bad service
The strange thing is why the sequences reset to 1.
Just to understand better, before you saw the data gone, what was the last thing you did with Prisma/Postgres? Did you run a migration, push? This will help pinpoint why the sequences reset to 1?
@PhucPham @Toonsa
Even if you upgrade right now to a Pro (or higher) plan, unfortunately you won’t be able to access past backups,This is incorrect. If you upgrade your plan, you will be able to access backups. Backups are taken irrespective of your plan, so backups are taken on free plan as well. You get access to backups only on Pro/Business plan, similar to other database providers. So, if you upgrade now, you will be able to get back your data.
Just to understand better, before you saw the data gone, what was the last thing you did with Prisma/Postgres? DI agree, this would be helpful to know.
Ah sorry I have been mislead by this line:
"On Pro and Business plans, Prisma Postgres automatically creates snapshots of your database to support recovery and backup workflows." 🙁
Thanks for letting me know. I believe we have an opportunity to make it clear that backups are taken for all databases, even the ones on free plan. 👍