Rails 5 - Create seed.rb file from production database in Heroku
This file contains 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