When I log onto the website (example.herokuapp.com) and create a user, the user is created in the Heroku Postgres::Database but when I go into Cloud9 and enter Rails Console, the user does not exist in my production database. How can I merge the changes made in production (Heroku) with development (local Rails) so that these users show up in Rails Console? Thanks.
Asked
Active
Viewed 145 times
-1
-
use Stack Overflow to find answers to your questions before you post them http://stackoverflow.com/questions/33007279/heroku-rails-rake-task-to-sync-production-local-db or http://stackoverflow.com/questions/23088421/postgres-copy-heroku-production-db-to-local-development-db or ... – MilesStanfield Dec 29 '15 at 03:35
-
I see now that I can do $ heroku run console and then view the users in the database and make changes that way. is there any advantage/disadvantage to merging/not merging databases? – Shaomai888 Dec 29 '15 at 03:41
1 Answers
0
If you need the users to show up in the console you can run
heroku run console --app APP_NAME
If you'd like to "merge" the database you have to export your heroku Postgres database and convert the table to SQL format.
For more information about exporting PG Backups: https://devcenter.heroku.com/articles/heroku-postgres-import-export
Another stackoverflow post that might help: How to I merge two databases with same schema that are on Heroku?