I have successfully deployed my Rails app to Heroku. It is working fine but I am unable to pull the data into my local database
Local postgres database name is development
Here is my database.yaml file
development:
adapter: postgresql
database: development
username: ambanerj
password: *********
host: localhost
encoding: UTF8
pool: 5
timeout: 5000
production:
adapter: postgresql
database: development
host: localhost
username: ambanerj
password: *********
pool: 5
timeout: 5000
test:
adapter: postgresql
database: app_test
host: localhost
username: ambanerj
password: *********
pool: 5
timeout: 5000
When I run the command
heroku pg:pull
I get this
Usage: heroku pg:pull <REMOTE_SOURCE_DATABASE> <LOCAL_TARGET_DATABASE>
pull from REMOTE_SOURCE_DATABASE to LOCAL_TARGET_DATABASE
LOCAL_TARGET_DATABASE must not already exist.
Can anyone tell me how do I go about this one and pull data from my Heroku DB into local development database? I have tried pg:pull with the options without success
Here is what I see in my Heroku dashboard.
Host ec2-54-225-101-18.compute-1.amazonaws.com
Database dd8hgh6m3vl6t7
User mckuffxoufgewi
Port 5432
Password
Psql heroku pg:psql --app immense-dawn-3007 black
URL
Please tell me the format of using pg:pull command with an example if possible.
P.S: I tried using Taps gem without success
To pull pg
remote database to your local, you need to follow following command from your app root terminal:
heroku pg:pull HEROKU_POSTGRESQL_[SOME COLOR NAME] mylocaldb --app shushi
This command will create a new local database named “mylocaldb” and then pull data from database at DATABASE_URL from the app “sushi”. In order to prevent accidental data overwrites and loss, the local database must not exist. Read more
When you do heroku config:get -a secure-gorge-4090, you should see an entry for HEROKU_POSTGRESQL_[SOME COLOR NAME]. Make sure you're using whatever that token is instead of DATABASE in your commands. courtesy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With