0

I don't understand how to import a local database to aws. I see : 'upload files' but how do I even get my database into a file?! Im so confused. I am trying to deploy my app with heroku so as I understand I have to first export it to (for example) was then from there to my heroku database and have found this command:

PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump

Nothing really happens and I don't understand what password I am suppose to use.. Any help would be very much appreciated!

1 Answer 1

1

To upload your PG database to Heroku, first you need to do pg_dump to export its contents (you basically have the right string above, I would try it without the "PGPASSWORD"; "mydb" is the name of your local database and "myuser" you can probably leave as "postgres"; "mydb.dump" is the name of the dump file that you'll want to upload to S3). Then you can upload it to AWS S3, make it public, and then pull it into Heroku with heroku pg:backups restore 'https://s3.amazonaws.com/me/items/3H0q/mydb.dump' DATABASE_URL. Here are the Heroku docs: https://devcenter.heroku.com/articles/heroku-postgres-import-export.

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.