Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best Way to Export CouchDB?

Tags:

couchdb

I'm new in CouchDb, And sometimes I need to export my Database. Until Now I used this command

curl -X GET http://127.0.0.1:5984/nomeDB/_all_docs\?include_docs\=true > /Users/bob/Desktop/db.json

But in this way, before import my Dump with this command

curl -d @db.json -H "Content-type: application/json" -X POST http://127.0.0.1:5984/dbName/_bulk_docs

I have to correct the Json with

"rows": [   =====>   "docs": [

And in this way My documents have one more key, the doc key.

What is the best way to do a Dump to pass, for example, to another developer?

like image 216
monkeyUser Avatar asked Sep 07 '15 15:09

monkeyUser


People also ask

How do I backup my CouchDB?

To back up CouchDB data, use CouchDB replication to back up the data to another CouchDB installation. You can choose between a normal replication in one-shot mode or continuous replications. Back up all CouchDB databases. Use CouchDB replication to recover the backup databases from the backup CouchDB instance.

Is CouchDB scalable?

Scalability. The architectural design of CouchDB makes it extremely adaptable when partitioning databases and scaling data onto multiple nodes. CouchDB supports both horizontal partitioning and replication to create an easily managed solution for balancing both read and write loads during a database deployment.

Is CouchDB distributed?

CouchDB is a peer-based distributed database system.

Is CouchDB cloud based?

Container and Cloud DeploymentsCouchbase is cloud-native and architected to work on any cloud.


1 Answers

The easiest export/import and backup/restore strategy is to simply copy the raw database file. Usually, this file is located at /var/lib/couchdb/my-database.couch. You can safely copy this file, even while the database is running. (Source)

Another option is to use replication to copy entire databases between servers. This option can be done incrementally, unlike the first.

like image 53
Dominic Barnes Avatar answered Sep 19 '22 20:09

Dominic Barnes