After cloning the project, execute the command below to download all needed libraries:
$ npm install
Now you can start replicating a CouchDB (source) to another instance of CouchDB (target).
$ npm start <source url><target url>
or you can also execute the following commands:
$ npm run build
$ node dist/replicate-couchdb.js <source url><target url>
In each case, if the arguments are wrong, a screen will show how to execute the replication correctly:
replicate-couchdb.js
Commands:
replicate-couchdb.js Replicate the source CouchDB to the target
Options:
--version Show version number [boolean]
--help Show help [boolean]
Examples:
replicate-couchdb.js http://192.168.172.100:5984/mydatabase http://user:password@localhost:5984/mydatabase
Cleaning before new replication
The replicate-couchdb creates temporarily a local database in the folder ./tempdb. Before starting a new replication, certify to clean everything running the command below:
$ npm run clean-all
This command removes the folder ./tempdb. Otherwise, the existing content will be also replicated to the target CouchDB.
Replication Only
After replicating once, you can replicate the temporarily local database to another CouchDB instances. For this, you have to run teh command below:
$ npm run build
$ node dist/replicate-only-couchdb.js <target url>