CouchDB not replicating design documents
Asked Answered
V

2

9

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?

Vibrate answered 20/9, 2012 at 10:23 Comment(0)
O
18

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
Object answered 21/9, 2012 at 15:49 Comment(1)
As it turns out, Futon gets the design documents and views via ajax calls. So you have to wait for a while before they show up..Vibrate
H
-1

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).

Hallucinatory answered 12/2, 2019 at 7:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.