Capistrano Db & Data Sync Recipes

Recipes to clone database & public data from production server to developement machine.

Installation

Add this to your Gemfile

group :development do
  gem 'cap_sync'
end

Add following line to your deploy.rb:

require 'cap_sync/capistrano'

Syncing database

> bundle exec cap sync:db

See lib/cap_sync/db.rb for list of available options.

You can set: local & remote environment, mysql dump/client command & flags, turn compression on/off, etc.

Syncing data

> bundle exec cap sync:data

Rsync’s local and remote folders. By default, does incremental implicit synchronization with rsync.

See lib/cap_sync/data.rb for list of available options.

Todo

  1. Correctly handle multiple servers (database).

  2. Envflags to modify options on the fly.

  3. Win32 compability.