Skip to content

Instantly share code, notes, and snippets.

Created January 10, 2018 21:12
What would you like to do?
Rails 5 - Create seed.rb file from production database in Heroku
# 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