1

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 ?

1 Answer 1

2

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'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.