0

I have a rails app deployed on heroku with postgres db.

My goal is to get a copy of the db to my local machine. So, I followed the 3-liner instruction: https://devcenter.heroku.com/articles/heroku-postgres-import-export#export

There were errors in my localhost app, and I traced the problem to be that pg_restore didnt fill one of the tables, while rest of the table is filled

Question is:

  1. how is this possible?
  2. what are the things I can check to debug how this happened?

EDIT:

looks like this is behaving nicely (and solves my problem):
rake db:drop db:create then pg_restore db.dump

but this is not: rake db:drop db:create db:migrate then pg_restore db.dump

Sida Zhou
  • 3,529
  • 2
  • 33
  • 48

1 Answers1

1

In order to check if it's a heroku bug or not try to backup/restore using psql:

pg_dump -o -h host -U user -d database -n "\"SCHEMA\"" > test.dump
psql -U user database < test.dump 

If you have all tables presented it means it's better to log a case with heroku support.

Dmitry S
  • 4,990
  • 2
  • 24
  • 32
  • Worth trying. You can get heroku db credentials here: http://stackoverflow.com/questions/15778365/postgres-on-heroku-and-dumping-single-table-to-dump-file – Sida Zhou Aug 28 '15 at 23:44