mongo-transporter

module
v0.0.0-...-d903027 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2014 License: BSD-3-Clause

README

A dead simple Go app that uses the Compose Transporter to transfer data between two MongoDB deployments and keep them in sync.

What's it good for?

  • Keeping dev, staging and production DB's in sync.
  • Zero-downtime migrations from one deployment to another.

Deploy!

Deploy

Click the deploy button to launch a new app instance, add your config/environment variables in the Heroku dashboard and click "Deploy for Free". This will create a new Heroku app. You will need to scale manually to one worker dyno via the dashboard or the command line (worker dynos do not scale automatically when deploying): heroku ps:scale worker=1

Config vars

  • SOURCE_MONGO_URL - This is the full connection URI of the MongoDB deployment that you want to sync from. eg. mongodb://username:strongpassword@candidate.44.mongolayer.com:10000/local?authSource=prod_db You will need to create a user that can read from the local.oplog.rs namespace. You can use the URI for either the primary or secondary node.
  • SOURCE_DB - The DB name to sync from. eg. prod_db
  • DESTINATION_MONGO_URL - This is the full connection URI of the MongoDB deployment that you want to sync to. eg. mongodb://username:strongpassword@candidate.44.mongolayer.com:30000/staging_db The user does not need to authenticate to the local DB. You can use the URI for either the primary or secondary node.
  • DEST_DB - The DB name to sync from. eg. staging_db

What is does

What it does not do (yet)

  • Copy DB users
  • Copy Indexes

Thanks

The engineers at Compose for making an awesome tool, Transporter.

This app uses the Go Buildpack for Heroku by @kr: https://github.com/kr/heroku-buildpack-go

To Do

  1. 2.4/2.6 caveats
  2. Comma seperated list of collections to ignore

License

Copyright (c) 2014, Compose, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of [project] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Directories

Path Synopsis
Godeps
_workspace/src/code.google.com/p/goprotobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
_workspace/src/github.com/bitly/go-hostpool
A Go package to intelligently and flexibly pool among multiple hosts from your Go application.
A Go package to intelligently and flexibly pool among multiple hosts from your Go application.
_workspace/src/github.com/compose/transporter/pkg/message
Package message provides wrapper structs and helper methods to pipe actual database documents throughout transporter.
Package message provides wrapper structs and helper methods to pipe actual database documents throughout transporter.
_workspace/src/github.com/compose/transporter/pkg/pipe
Package pipe provides types to help manage transporter communication channels as well as event types.
Package pipe provides types to help manage transporter communication channels as well as event types.
_workspace/src/github.com/compose/transporter/pkg/transporter
Package transporter provides all adaptoremented functionality to move data through transporter.
Package transporter provides all adaptoremented functionality to move data through transporter.
Go driver for RethinkDB
_workspace/src/github.com/dancannon/gorethink/ql2
Package ql2 is a generated protocol buffer package.
Package ql2 is a generated protocol buffer package.
_workspace/src/github.com/robertkrimen/otto
Package otto is a JavaScript parser and interpreter written natively in Go.
Package otto is a JavaScript parser and interpreter written natively in Go.
_workspace/src/github.com/robertkrimen/otto/ast
Package ast declares types representing a JavaScript AST.
Package ast declares types representing a JavaScript AST.
_workspace/src/github.com/robertkrimen/otto/dbg
Package dbg is a println/printf/log-debugging utility library.
Package dbg is a println/printf/log-debugging utility library.
_workspace/src/github.com/robertkrimen/otto/file
Package file encapsulates the file abstractions used by the ast & parser.
Package file encapsulates the file abstractions used by the ast & parser.
_workspace/src/github.com/robertkrimen/otto/parser
Package parser implements a parser for JavaScript.
Package parser implements a parser for JavaScript.
_workspace/src/github.com/robertkrimen/otto/registry
Package registry is an expirmental package to facillitate altering the otto runtime via import.
Package registry is an expirmental package to facillitate altering the otto runtime via import.
_workspace/src/github.com/robertkrimen/otto/terst
Package terst is a terse (terst = test + terse), easy-to-use testing library for Go.
Package terst is a terse (terst = test + terse), easy-to-use testing library for Go.
_workspace/src/github.com/robertkrimen/otto/token
Package token defines constants representing the lexical tokens of JavaScript (ECMA5).
Package token defines constants representing the lexical tokens of JavaScript (ECMA5).
_workspace/src/github.com/robertkrimen/otto/underscore
Package underscore contains the source for the JavaScript utility-belt library.
Package underscore contains the source for the JavaScript utility-belt library.
_workspace/src/gopkg.in/fatih/pool.v2
Package pool implements a pool of net.Conn interfaces to manage and reuse them.
Package pool implements a pool of net.Conn interfaces to manage and reuse them.
_workspace/src/gopkg.in/mgo.v2
Package mgo offers a rich MongoDB driver for Go.
Package mgo offers a rich MongoDB driver for Go.
_workspace/src/gopkg.in/mgo.v2/bson
Package bson is an implementation of the BSON specification for Go:
Package bson is an implementation of the BSON specification for Go:
_workspace/src/gopkg.in/mgo.v2/internal/scram
Pacakage scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
Pacakage scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
_workspace/src/gopkg.in/mgo.v2/txn
The txn package implements support for multi-document transactions.
The txn package implements support for multi-document transactions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL