Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you migrate heroku databases between apps using forking?

We have a production database, and we'd like to take regular snapshots of it to our staging database.

I know how to do this using pgbackups, I was wondering if anyone knows how to do it with the new HerokuPostgres fork function.

like image 482
Alex Avatar asked Jun 08 '12 15:06

Alex


1 Answers

Yes, you can create a fork from directly from one applications DB to another. To do this get the value for your DATABASE_URL from your primary application then use it in the below command:

heroku addons:add heroku-postgresql:ronin --fork postgres://username:password@ec2.../database --app yourstagingapp
like image 119
CraigKerstiens Avatar answered Sep 18 '22 16:09

CraigKerstiens