Skip to content

Instantly share code, notes, and snippets.

💭
working on datafruits

Tony Miller mcfiredrill

💭
working on datafruits
Block or report user

Report or block mcfiredrill

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View README.md

Overview

Replicate is a Gem that lets you dump and load relational objects between Ruby/Ruby on Rails environments, e.g. dump data from your production database and load it in your development database.

The examples given in the README are of shell scripts being used to do this. I wanted to use a Capistrano task because it keeps everything related to the production site in one place (particularly the config).

Note: This is tested on a relatively small data set yet it still took about 20 seconds to run - YMMV!

Usage

  • Add the code below to your config/deploy.rb
  • Alter the code = ENV["DATA"] || "User.all; Project.all" line to list all the data you want dumped by default
You can’t perform that action at this time.