[Django]-403 error when trying to backup AWS S3 database to heroku postgres

3đź‘Ť

âś…

Well, I feel dumb, but the reason for the issues was that I was forgetting to add “.dump” to the end of the filename in my AWS url.

👤Jonathan Cox

3đź‘Ť

Same Error Pulling From AWS into Heroku

Heroku will sometimes refuse to import a backup/dump file if permissions are not set properly on the dump file inside the AWS bucket. (If Heroku can’t access the file, it can’t upload it.)

You can find the permission settings under either the Actions > Properties button or by clicking on the file and then clicking the button “Properties” on the right hand side.

One easy fix is to temporarily make the dump file public, do your heroku restore, and then lock down or delete the dump file.

👤knappen

-1đź‘Ť

For windows users;
heroku pg:backups:restore "https://s3.amazonaws.com/me/items/3H0q/mydb.dump" DATABASE_URL

According to the official docs, be sure to use double-quotes around the remote url if you’re using windows. see official docs

👤shaded

Leave a comment