Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I tried this on RubyMine Terminal:

heroku pg:push ror_development postgres://budobqbtsbzmlx:hUNYKkaMap-cExovtPJat4ajPm@ec2-54-217-208-1 58.eu-west-1.compute.amazonaws.com:5432/dbhsnsvf36h8tu

But its return me error:

Unknown database: postgres://budobqbtsbzmlx:hUNYKkaMap-cExovtPJat4ajPm@ec2-54-217-208-158.eu-west-1.compute.amazonaws. com:5432/dbhsnsvf36h8tu. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_ONYX_URL

and also this error:

Connecting to HEROKU_POSTGRESQL_ONYX_URL (DATABASE_URL) 'psql' is not recognized as an internal or external command, operable program or batch file.

Can somebody show detail sample of doing this action on windows ?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The error message states that you should use the environment variables rather than explicit names. The documentation states you should do something like:
heroku pg:push mylocaldb HEROKU_POSTGRESQL_ONYX

That said, I've never used this technique but did manage to successfully push my local db to heroku postgresql using this procedure.

Here's the short version:

  1. install pgbackups:
    heroku addons:add pgbackups

  2. backup your local db:
    pg_dump -Fc --no-acl --no-owner -h localhost -U <user> <dbname> > local_pg.dump

  3. upload this file to a web server (I use S3 or dropbox). Let's assume http://www.dropbox.com/me/local_pg.dump

  4. now restore into your heroky db:
    heroku pgbackups:restore DATABASE 'http://www.dropbox.com/me/local_pg.dump'

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.