4

Last night I was asked to take down a client's website and close out their accounts as they are going out of business. I made sure to go to the Heroku Dashboard, go into the Heroku Postgres dashboard, Durability > Create Manual Backup.

I then downloaded the back up to my computer just in case something came up.

Once I had the backup downloaded, I deleted everything off of Heroku.

Well sure enough they messaged me today because they wanted to look at some data. However I closed the project completely. Now I'm left with this backup file format extension, so I don't know what to do with it. Something like: "1c02eb4e-d4ac-4631-9b61-742e9ea42659"

I have Postgres installed on my dev machine and I still have a dev version of the Ruby on Rails project set up. Is there a Heroku CLI command I can use to replace my dev database with this backup? Or is there a GUI program I can open this up in and write some queries? I'm on Mac Mojave.

user3339471
  • 295
  • 2
  • 10
  • What is the extension on the backup file downloaded from Heroku? Should be able to use `psql` utility locally – avimoondra Apr 01 '20 at 18:51
  • There are tons of GUI applications that you can use on a Postgres database after you have restored the backup (and even GUI applications that create databases from a backup) but software recommendations are off topic on stackoverflow. – max Apr 02 '20 at 08:21
  • Using PGAdmin as described in this [answer](https://stackoverflow.com/a/24815230/3468846) – petitkriket Apr 02 '20 at 11:23
  • Shouldn't need any gui software or application, all command line. See: https://devcenter.heroku.com/articles/heroku-postgres-import-export#restore-to-local-database, added edits to an answer below. – avimoondra Apr 02 '20 at 17:54

1 Answers1

-2

Here is the command to load the dump file on development

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U [username] -d [database name] infile

Relevant documentation: https://devcenter.heroku.com/articles/heroku-postgres-import-export#restore-to-local-database

avimoondra
  • 886
  • 5
  • 9
Maueez Ahmed
  • 115
  • 4