mongo-sync-go Inspired from https://github.com/sheharyarn/mongo-sync
Setup
- Create a config file
~/.mongo-sync.yaml
by copying provided template file:.mongo-sync.yaml.template
- Update
~/.mongo-sync.yaml
file 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=mydb
Sync/copy database:
mydb
from remote server into database namemydb
in 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-db
Sync/copy database:
mydb
from remote server into database namemy-local-db
in local server -
mongo-sync-go pull --remote.host=mongo.remote --local.host=mongo.local --remote.database=mydb
Sync/copy database:
mydb
from host:mongo.remote
to database namemy-db
onto servermongo.local
-
mongo-sync-go pull -h
to see all available options