No commit activity in last 3 years
No release in over 3 years
A tool for keeping local mongo in sync with remote
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.8
~> 1.1

Runtime

~> 1.2
 Project Readme

capistrano-mongo-sync

Use capistrano-mongo-sync to sync your local development database from your production database using:

cap production mongo:pull

Or sync just one collection from the database:

COLLECTION=users cap production mongo:pull

Or sync your staging database from your production database.

cap production mongo:sync_prod_to_staging

If you've already downloaded a mongo dump with the cap task, it will ask you if you'd like to use that local dump. If someone has already created a mongo dump recently on the remote server, the cap task will ask if you'd like to use that dump. Older mongodumps, both remote and local, will be deleted when you run the cap task.

Usage

Add to your Gemfile:

gem 'capistrano-mongo-sync'

Require in Capfile to use the predefined tasks:

require 'capistrano/mongo-sync'

In deploy.rb, set some variables:

set :production_db, 'PRODUCTION_DB'
set :development_db, 'DEVELOPMENT_DB'

set some optional variables:

set :staging_db, 'STAGING_DB'

enable hipchat notifications (requires hipchat gem):

set :hipchat_client, HipChat::Client.new('HIPCHAT_TOKEN')

change where mongodumps are kept remotely and locally:

set :remote_dump_base, '/tmp/dumps'
set :local_dump_base, '/tmp/dumps'

Or write your own tasks using the MongoSync class