3

I pushed my app to heroku, but it seems that the database did not migrate (the database has 0 tables and 0 entries). How can I migrate it correctly?

babbaggeii
  • 7,577
  • 20
  • 64
  • 118
  • i'm not too familiar with heroku, but was your sqlite db underversion control? How did you transfer your dev db to heroku? You could `dumpdata` locally and `loaddata` on your heroku – dm03514 Apr 12 '13 at 14:23
  • The db was under version control, but this is actually the first version as I was migrating a new app from an old computer. I'm going to try to dumpdata locally and then transfer it to the new database server. – babbaggeii Apr 12 '13 at 15:00
  • are you using migrate in copying your data to Heroku? – catherine Apr 12 '13 at 15:22

1 Answers1

3

If you're using the Starter-tier databases, there is a delay in populating those stats. You can see if there are tables immediately if you psql in:

$ heroku pg:psql -a app_name
psql=> \dt
[...tables...] 

Also, please see my answer here on using postgres locally instead of sqlite3 (recommended):

Community
  • 1
  • 1
catsby
  • 11,276
  • 3
  • 37
  • 37
  • 1
    Thanks, I ran that command and it gave "No relations found". I am indeed using the starter-tier database so maybe I'll wait until tomorrow and check it again. In the meantime, I think I'll take that advice and migrate my local database to postresql, then push it again to heroku. – babbaggeii Apr 12 '13 at 15:16
  • 1
    the `\dt` command is immediate. If it finds nothing, there's nothing there. Migrate to postgres locally and try again. import/export guide: https://devcenter.heroku.com/articles/heroku-postgres-import-export – catsby Apr 12 '13 at 15:24