Replication in CouchDB is peer-based and bi-directional, although any
given replication process is one-way, from the source
to the target. Replication can be run from Futon,
CouchDB’s web administration console, or by sending a
POST request to
_replicate containing a JSON
object with replication parameters. Let’s assume we have two databases, both
running on the same CouchDB node, that we want to replicate:
catalog-b (we can also replicate databases on
different CouchDB nodes).
Navigate to http://localhost:5984/_utils/ using your web browser.
Create a new, empty document (with only an
_id field) in the
Under “Tools,” click “Replicator.”
Under “Replicate changes from,” leave “Local database” selected, and select “catalog-a.”
Under “to,” leave “Local database” selected, and select “catalog-b.”
Click the “Replicate” button. Figure 3-1 shows how everything should look (the details under “Event” will be different for you). Optionally, you could have checked “Continuous” to trigger continuous replication.
If you would prefer to use cURL, first create the
curl -X PUT http://localhost:5984/catalog-a
curl -X PUT http://localhost:5984/catalog-b
The response: ...