Created
January 10, 2018 21:12
-
-
Save lopezjurip/f24709a66c63c8916d42bde1b1510c7d to your computer and use it in GitHub Desktop.
Rails 5 - Create seed.rb file from production database in Heroku
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download with Heroku CLI | |
heroku pg:backups:capture | |
heroku pg:backups:download | |
# Should create a dump file, let's name it 'latest.dump' | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d MY_APP_development latest.dump | |
# Install 'seed_dump' gem | |
bundle exec rake db:seed:dump EXCLUDE=encrypted_password,reset_password_token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment