ruby on rails - Easiest way to dump Heroku database for use in local seed.rb? -
i can dump heroku database $ heroku pgbackups:capture
. also, this post shows there tools taking development database , dumping seed.rb.
i'm wondering if there easy way combine 2 processes, dumping info production heroku database local seeds.rb more realistic development testing.
if possible, what's cleanest way this?
update:
based on insightful reply db', may consider using pgsql locally. still interested, however, in seed.rb aspect of question if there way easily.
there couple ways accomplish such thing. @db' has outlined 1 of them - using the pg backups add-on export database. it's great options involves few (trivial) manual commands.
i recommend using pg:transfer heroku cli plugin transfer info in single step. under covers it's still much same thing happening using pg backups, it's packaged bit nicer , has useful defaults.
from app's directory, re-create production database locally (assuming local pg db), installing plugin , execute pg:transfer
command.
$ heroku plugins:install https://github.com/ddollar/heroku-pg-transfer $ heroku pg:transfer
there couple options can set well. see my writeup more details.
hope helps! , yes, please utilize same database during development in production.
ruby-on-rails ruby-on-rails-3 heroku seeding database-dump
No comments:
Post a Comment