Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku pg:backups:restore from local database

Tags:

heroku

Heroku cannot access my google drive file but it is publicly accessible: https://drive.google.com/uc?export=download&id=0B4cYno3qd3jwSnN5V0JtOVZBb1k

Heroku errors:
1, please check the source URL and ensure it is publicly accessible
2, 'id' is not recognized as an internal or external command, operable program or batch file.

My code:
heroku pg:backups:restore "https://drive.google.com/uc?export=download&id=0B4cYno3qd3jwSnN5V0JtOVZBb1k" DATABASE_URL --app express-tourism

You can take a look at cmd line screenshot here

like image 487
Etomanon Avatar asked Sep 12 '17 14:09

Etomanon


People also ask

Where are Heroku backups stored?

Snapshots are stored directly in AWS's S3 object store. Base backups and WAL files are pushed to' S3 through an application called WAL-E as soon as they are made available by Postgres. All databases managed by Heroku Postgres provide continuous protection by persisting snapshots, base backups and WAL files to S3.


2 Answers

Got the same issue while using Google drive and then Dropbox. I resolved this by using Dropbox and changing url's 'https' to 'http'.

As per Heroku's docs:

In order for PG Backups to access and import your dump file you will need to upload it somewhere with an HTTP-accessible URL.

Keep in mind the URL should be a downloadable link as in the mentioned question. Hope this helps.

like image 100
Ashutosh Kushwaha Avatar answered Oct 01 '22 16:10

Ashutosh Kushwaha


https://zapier.com/learn/how-to/generate-direct-dropbox-link/

Example https://dl.dropboxusercontent.com/s/49xukdo0vd22pb8/test.file?dl=0

Remove the URL params (e.g. ?dl=0) and it will work!

like image 41
Pencilcheck Avatar answered Oct 01 '22 16:10

Pencilcheck