9
votes

I have a CouchDB 1.2.0 instance running on my laptop and I want to replicate a local database named "soup" to a remote machine, which runs a CouchDB 1.1.1 instance. I issue the replication from futon and I can see the request is alright:

Request URL:http://127.0.0.1:5984/_replicate
Request Method:POST
Request Payload: {"source":"soup","target":"http://projects.blurrcat.com/couchdb/soup"}

However, when the replication is done, all documents except the design documents are replicated. Can anyone tell me why? Is it because of the version difference?

2

2 Answers

17
votes

Design documents will only replicate if you are authenticated as an admin, or a db admin, on your target. Try something like setting your target as

http://admin:[email protected]/couchdb/soup
-1
votes

As the other answer says, the user doing the replication has to be admin for the target DB, but there is more.

When replicating to a local DB also double-check that there is user_ctx defined in the replication document with a role _admin. Otherwise CouchDB will not replicate design document. See documentation of replicator - delegations.

If your CouchDB instance is hidden behind Nginx or Apache, make sure your design document doesn't exceed the maximal allowed size of a http request. Mine did and there was no obvious error message (in Nginx set larger client_max_body_size).