What to do after Heroku pg:pull?

478 views Asked by At

After much research, I successfully ran heroku pg:pull (MYAPPNAME)::URL mylocaldb; however, my localhost website is not updated with the database from Heroku. Is there another step I should do now? I tried to run it again and it says ERROR: database "mylocaldb" already exists so it was successful.

If you have any ideas, please let me know. I am simply trying to restore my database on my localhost from what my website (http://www.joedayvie.com) currently has.

Thank you!

1

There are 1 answers

0
Programmingjoe On

Taken from here: https://devcenter.heroku.com/articles/heroku-postgresql

I think you're missing a few things:

heroku pg:pull HEROKU_POSTGRESQL_SOMECOLOR mylocaldb --app appnameonheroku

is the format you should be using, you can also add the username and password to your pull like this:

PGUSER=postgres PGPASSWORD=password heroku pg:pull HEROKU_POSTGRESQL_SOMECOLOR mylocaldb --app appnameonheroku

So either you need to edit your command a bit

OR

The error message is saying that the database already exists because you do already have an existing database. To prevent data overwriting heroku asks that you delete your local database before pulling a heroku database. You should be given an option to do this when you pull.