Min Ming Lo
Min Ming Lo

Reputation: 2508

Heroku pgbackup restore error - DATABASE_URL does not match any of your databases ! Could not resolve database DATABASE ! ! Available databases:

Kept getting

DATABASE_URL does not match any of your databases ! Could not resolve database DATABASE ! ! Available databases:

when I try to transfer from production to my staging

pgbackups:capture --app myapp

pgbackups:restore DATABASE heroku pgbackups:url --app myapp --app myapp-staging

Upvotes: 2

Views: 1123

Answers (2)

Marc
Marc

Reputation: 1185

Apparently you have to push some code to the repository first before the database becomes available. (I don't think it's created until then.)

Upvotes: 0

John Beynon
John Beynon

Reputation: 37507

From http://devcenter.heroku.com/articles/pgbackups#transfers

heroku pgbackups:capture --app myapp
heroku pgbackups:restore DATABASE `heroku pgbackups:url --app myapp` --app myapp-staging

The back ticks are important! Are you using the correct application name passed into --app?

Upvotes: 1

Related Questions