Tapsuey is a Rails plugin that helps you copy production data down into your development environment.
script/plugin install git://github.com/matthewtodd/tapsuey.git
script/generate tapsuey # edit config/initializers/tapsuey.rb
A `cap tapsuey:db:pull` task is provided so you can sync your staging environment with production when you deploy. (A guard clause is included so that the task has no effect in production.)
You might hook it up like so:
after 'deploy:update_code', 'tapsuey:db:pull'
If you're using Paperclip and keeping files on the filesystem rather than S3, you'll also want to pull those down:
namespace :db do namespace :pull do desc 'Pull production files to the local filesystem.' task :files do system 'rsync -rP --delete myapp:shared/public/system/ public/system' end end task :pull => 'db:pull:files' end