0

I uploaded my application to heroku, recently im using PostgreSql also on my local machine, now i would like to know how i also can push my database with the existing records to Heroku? Is this possible?

Also it would be intresting if i can adopt my sql database to PostgreSql?

Thanks!

1

1 Answer 1

1

You can use pg_restore to push a dump file from a local database to an Heroku database.

If you go to the Herokue Postgres page for the database they give connection settings for a number of utilities, one of them being pg_restore. The command will look similar to:

PGPASSWORD=jyb4fhiwyeioghfwc7hw pg_restore --verbose --clean --no-acl --no-owner -h ec2-23-254-171-15.eu-west-1.compute.amazonaws.com -U hqfy134fblqwheb -d sdjhufhqwuf -p 5432 [YOUR_DATA_FILE]

Just substitute in the name of your local file. If the Heroku database is completely empty you can omit the -clean option and save some time.

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.