Heroku pgbackups - how does it work?

I am trying to migrate a database to a new application from an existing one using pgbackups, but I have problems. I read the documentation on devilus website, but I still get errors.

I have a plugin installed for both databases and I can successfully go to the original db and copy / grab it.

$ heroku pgbackups:capture -a costrecovery --expire HEROKU_POSTGRESQL_ONYX_URL (DATABASE_URL) ----backup---> b007 ←[0KCapturing... doneB - ←[0KStoring... done 

And then I go to the application directory where I want to copy db and follow the instructions given in the heroku file. The problem is that I do not know if it does not work because it is a mistake, or if it is because I do not interpret the instructions correctly, which is quite possible. First, I will list the instructions from heroku dev, and then the commands that I tried.

HEROKUS INSTRUCTIONS

 $ heroku pgbackups:restore DATABASE -a target-app \ `heroku pgbackups:url -a source-app` 

TEAMS I GOT

 $ heroku pgbackups:restore DATABASE_URL -a boiling-reef-2060 \ > heroku pgbackups:url -a costrecovery ! Backup not found $ heroku pgbackups:restore HEROKU_POSTGRESQL_GREEN_URL -a boiling-reef-2060 \ > 'heroku pgbackups:url -a costrecovery' ! Backup not found $ heroku pgbackups:restore DATABASE -a boiling-reef-2060 \ > 'heroku pgbackups:url -a costrecovery' ! Backup not found $ heroku pgbackups:restore DATABASE_URL -a costrecovery-copy2 \ > heroku pgbackups:"https://s3.amazonaws.com/hkpgbackups/ app405411@heroku.com /b 007.dump?AWSAccessKe > yId=AKIAJFDIRYCGYNFXR4FQ&Expires=1365184330&Signature=po0wZ982Jbx%2Fkv0bKk0iv P%2 > FRWac%3D" ! Resource not found 

Can someone help me with the correct syntax? Thanks

+4
source share
1 answer

pgbackups can be restored from the database in the same application or from any pgbackups url as in the one you captured in the source application / database. The instructions use backticks (`) to unload and capture the pgbackups url from your source application. The pgbackups: url command will provide such a URL. Try running this to see what happens:

 heroku pgbackups:url -a costrecovery 

(provided that the recovery is the place where you took the data).

Knowing this, you should simply run:

 heroku pgbackups:restore DATABASE_URL --app boiling-reef-2060 `heroku pgbackups:url --app costrecovery 
+5
source

All Articles