Reputation: 325
By accident I run a script which was supposed to go through all rows and change a field in each row. But it messed up and set this field nil for each of the rows. I am looking for a way to get the previous version of my prod. db, does heroku keep automatically db dumps?
Upvotes: 0
Views: 39
Reputation: 605
At first you need to install PgAdmin
http://www.pgadmin.org/ then you need to connect your heroku database with the PgAdmin for that.
login to heroku dev center
Go to dash board --> databases-->select app database --> connection settings
Copy the details like database name, password,host
Click on add a new connection in PgAdmin
Paste above settings.
Now you have live db connection like Heroku,
then backup from PgAdmin
there.
Upvotes: 1
Reputation: 176382
Heroku provides a backup service called PGBackups, however you should have either configured it to run your backups periodically, or run a manual backup before performing the operation.
If you didn't configure any backup, then your only chance is to contact Heroku support and check if they can recover a previous backup for you.
Needless to say that you should always be prepared for such circumstance and you should really have configured a backup of your data.
Upvotes: 0
Reputation: 120
It looks like you have to have manually backup your DB prior to a mess up. https://devcenter.heroku.com/articles/heroku-postgres-backups
Upvotes: 1