Reputation: 8961
I have a database called CouchDB_SomeClient_live
. I then have this database replicating to a database CouchDB_SomeClient_live_shadow
, which I use to test database operations before doing anything on the live database.
The idea is that at any time the shadow can be deleted and it will be recreated as a copy of the live system. This works fine, but I always manually have to add security settings.
The replication document has the following settings:
{
"_id": "pull_CouchDB_SomeClient_live_to_shadow",
"source": "CouchDB_SomeClient_live",
"target": "CouchDB_SomeClient_live_shadow",
"create_target": true,
"continuous": true,
"user_ctx": {
"name": "admin",
"roles": [
"_admin"
]
},
"owner": "zach"
}
Upvotes: 0
Views: 447
Reputation: 3341
You can use a command line script to copy the security settings, e.g.
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT http://admin:admin_password@localhost:5984/foo/_security -d $(curl -X GET admin:admin_password@localhost:5984/foo/_security)
Source: CouchDB full replication
Upvotes: 1