Monier
Monier

Reputation: 11

copying database from app to another app on Heroku

we are using Heroku as our Cloud platform service Now I have 3 apps 1 as production and the other two as staging, development. I made some changed in staging app and I need to copy the database (Postgres) from production to staging. I found some guidelines in Heroku documentation but it's not clear. can any one share his experience with me? the database reach 25 GB Now

Upvotes: 0

Views: 346

Answers (1)

Denis Cornehl
Denis Cornehl

Reputation: 4182

As always, it depends. I see two ways:

  1. heroku backups / restore: just use the last backup you have, or create a new one, then restore it to the staging server.
  2. forking the database: on the staging app, delete the postgres addon, and recreate it as a fork (aka copy) of the production server. The --fast option makes it even faster when the data doesn't have to be 100% up-to-date.

Since 25 GB is already over the recommended size for normal Heroku backups (20 GB), I would recommend going for option 2.

(though we are using Heroku backups for a 200GB database without any issues).

Upvotes: 1

Related Questions