johan
johan

Reputation: 721

Heroku | How to retrieve the staging database?

My app is deployed on heroku.

In order to prepare and test everything before the app is launched I create most of my products on my staging environnement. Then I will copy it to the production env. Sorry for this silly question, I've no idea how to this with heroku...

$  heroku run bash
$ env | grep -i database
DATABASE_URL=postgres://prmzmsxxxxgc:fd2f444cefedfEEEcd0982e363826c4032ecbfaa391526c3422222227e6bb145@ec2-176-34-184-174.eu-west-1.compute.amazonaws.com:5432/xxxxxxxxxxxk


How do I connect to my db ? How can I send it on my computer and use it in another Env?

Upvotes: 0

Views: 108

Answers (1)

danielavila
danielavila

Reputation: 144

You have two options:

  1. you can connect your local project to the heroku database by adding DATABASE_URL to your environment variables:
DATABASE_URL=postgres://prmzmsxxxxgc:fd2f444cefedfEEEcd0982e363826c4032ecbfaa391526c3422222227e6bb145@ec2-176-34-184-174.eu-west-1.compute.amazonaws.com:5432/xxxxxxxxxxxk
  1. You can generate a dump of the heroku database and then mount it locally, you can see the instructions here.

Upvotes: 1

Related Questions