Kamilski81
Kamilski81

Reputation: 15107

How do i migrate data between heroku databases?

I have a current 'staging' database in 'heroku' and would like to migrate it into 'production' database? How could I do this? I looked into their taps app but it was not too clear of how it works?

Upvotes: 1

Views: 155

Answers (1)

John Beynon
John Beynon

Reputation: 37507

Two options,

  1. PGBackups - https://devcenter.heroku.com/articles/pgbackups - use against your staging database to back it up and then restore to your your production one. Looks at the Transfers sub heading in that page.

  2. Taps via heroku db:pull and heroku db:push - This you would use to pull your staging database to your local machine (doesn't matter what DB you're using locally) and then push it to your production application.

If you're dealing with a large dataset then option 1 is the best option to use. Option 2 also lets you only push specific tables if you uses the --tables <tablenames> argument which is useful in some occasions.

Upvotes: 4

Related Questions