Etomanon
Etomanon

Reputation: 77

Heroku pg:backups:restore from local database

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

Upvotes: 6

Views: 5506

Answers (6)

tomshy
tomshy

Reputation: 45

Dropbox works like a charm. Just make sure it's publicly accessible

Upvotes: 0

svikramjeet
svikramjeet

Reputation: 1945

You can try saving backup in S3 and it should work as heroku itself is saving backups on AWS S3.

Upvotes: 0

Pencilcheck
Pencilcheck

Reputation: 2942

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!

Upvotes: 4

Ashutosh Kushwaha
Ashutosh Kushwaha

Reputation: 121

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.

Upvotes: 6

kostr22
kostr22

Reputation: 576

I had no luck with Google Drive either. Dropbox have worked for me

Upvotes: 1

Michał Młoźniak
Michał Młoźniak

Reputation: 5556

Use single quotes around backup url. Heroku docs says:

If you’re using a Unix-like operating system be sure to use single quotes around the temporary S3 URL, because it might contain ampersands and other characters that will confuse your shell. If you’re running Windows, you must use double-quotes.

I guess it applies as well to Google Drive as to S3.

Upvotes: 0

Related Questions