Alex Rivera | Logout

CouchDB dump to file and load from file

Asked 2012-07-24T21:24:41.173
27

I cannot replicate between two couchdb servers, so I would like to dump to file from one server and load from file into the other server.

I used this statement to dump and it worked fine:

curl -X GET http://localhost:5984/<DATABASE_NAME>/_all_docs?include_docs=true > FILE.txt

But when I used this statement to load:

curl -d @FILE.txt -H “Content-Type: application/json” -X POST http://localhost:5984/<DATABASE_NAME>/_bulk_docs

it failed like this:

curl: (6) Could not resolve host: application; Host not found {"error":"bad_content_type","reason":"Content-Type must be application/json"}

Any ideas?

Edit
Report

1 Answer

7

The reason for your actual error is that you're using “ instead of plain ASCII " around your -H argument on the command line.

However, the real solution here is to just copy the <DATABASE_NAME>.couch file from the /path/to/var/lib/couchdb directory from one server to the other.

answered 2012-07-25T04:38:09.440

Your Answer