I'm trying to transfer the data from my production DB to my staging DB without success.
I'm following heroku's documentation on it: http://devcenter.heroku.com/articles/pgbackups#transfers
These are the commands I've run...
$ heroku addons:add pgbackups --remote staging
$ heroku addons:add pgbackups --remote production
$ heroku pgbackups:capture --remote production
$ heroku pgbackups:restore DATABASE `heroku pgbackups:url --remote production` --remote staging
And this is the message I get...
Usage: heroku pgbackups:restore [<DATABASE> [BACKUP_ID|BACKUP_URL]]
restore a backup to a database
if no DATABASE is specified, defaults to DATABASE_URL and latest backup
if DATABASE is specified, but no BACKUP_ID, defaults to latest backup
It seems I'm spelling something wrong, but I can't figure it out.
I've also tried the same command using the name of the apps instead of the remote...
$ heroku pgbackups:restore DATABASE `heroku pgbackups:url --app myapp` --app myapp-staging
But I get the same message with no actual transfer going on.
Any help is deeply appreciated.
I don't think you've captured correctly. Always use --app
instead of --remote
$ heroku pgbackups:capture --app myapp
$ heroku pgbackups:restore DATABASE `heroku pgbackups:url --app myapp` --app myapp-staging
Not sure if Heroku's changed since these were posted last January, but when I run
heroku pgbackups:restore DATABASE `heroku pgbackups:url --app myapp` --app myapp-staging
I kept getting an error that just said
"! Backup not found"
Even though, when I ran the command by itself to get the URL:
heroku pgbackups:url --app myapp
and then tried the URL out in the browser, that URL WAS correct.
So instead I just tried sending the copied/pasted URL to the command instead, like:
heroku pgbackups:restore DATABASE "http://urlgoeshere" --app myapp-staging
I had to use DOUBLE quotes around the URL, not SINGLE quotes. Otherwise I got this error:
The filename, directory name, or volume label syntax is incorrect. 'Expires' is not recognized as an internal or external command, operable program or batch file. 'Signature' is not recognized as an internal or external command, operable program or batch file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With