0

I made a mistake today by following this post : https://stackoverflow.com/a/34685657/10104165. As a result I lost a database with 104 tables. I managed to retrieve the table from Heroku when the app is running as well.

I followed these steps:

$ heroku pg:backups:capture

then :

$ heroku pg:backups:download

and finally:

$ pg_restore --verbose --clean --no-acl --no-owner -h localhost  -d project4_development latest.dump

I got all the data back, but for some reason the data_source in my rubymine window says that project4_development does not exist. A part from a few issues, the app seems to be running a usual.

How can I find out where (which database) are the data currently displayed coming from ?

Rene Chan
  • 864
  • 1
  • 11
  • 25
  • Which framework is your app server running from? Perhaps from database config files Or since you have mentioned heroku, heroku has environment variable `DATABASE_URL` that gives which database your app server is connecting to. – Surya May 02 '19 at 04:46
  • By `pg_restore --verbose --clean --no-acl --no-owner -h localhost -d project4_development latest.dump` you are trying to dump latest.dump into your localhost. And in your local there is no database that is named `project4_development` – Surya May 02 '19 at 04:48
  • Ok, so I should create another database first before running that command ? In that case, where are the data that I am currently seeing coming from ? – Rene Chan May 02 '19 at 05:03
  • You can fire up the console and run `ActiveRecord::Base.configurations` to see the database information – Eyeslandic May 02 '19 at 10:25
  • If you want to restore your local db from heroku jsut do: heroku pg:pull DATABASE_URL project4_development --app APPNAMEHERE – bkunzi01 May 02 '19 at 13:15
  • All good guys, I managed to plug the new data source to rubymine. Thank yOU! – Rene Chan May 02 '19 at 20:51

0 Answers0