mongo-sync-go Inspired from https://github.com/sheharyarn/mongo-sync
Setup
- Create a config file
~/.mongo-sync.yamlby copying provided template file:.mongo-sync.yaml.template - Update
~/.mongo-sync.yamlfile to to provide remote and local ( could be another remote database) mongo server configuration
Installing mongo-sync-go
-
Using homebrew
brew install bharat-p/tap/mongo-sync-go -
Download pre-built binary from:
-
build your own binary
go get github.com/bharat-p/mongo-sync-go cd $GOPATH/src/github.com/bharat-p/mongo-sync-go go build -o mongo-sync-go main.go
Usage
-
mongo-sync-go pull --remote.database=mydbSync/copy database:
mydbfrom remote server into database namemydbin local serverRemote and local database credentials/settings will be used from config file:
~/.mongo-sync.yaml -
mongo-sync-go pull --remote.database=mydb --local.database=my-local-dbSync/copy database:
mydbfrom remote server into database namemy-local-dbin local server -
mongo-sync-go pull --remote.host=mongo.remote --local.host=mongo.local --remote.database=mydbSync/copy database:
mydbfrom host:mongo.remoteto database namemy-dbonto servermongo.local -
mongo-sync-go pull -hto see all available options