databasecouchdbbackupadministration

CouchDB backups and cloning the database


We're looking at CouchdDB for a CMS-ish application. What are some common patterns, best practices and workflow advice surrounding backing up our production database?

I'm particularly interested in the process of cloning the database for use in development and testing.

Is it sufficient to just copy the files on disk out from under a live running instance? Can you clone database data between two live running instances?

Advice and description of the techniques you use will be greatly appreciated.


Solution

  • CouchDB supports replication, so just replicate to another instance of CouchDB and backup from there, avoiding disturbing where you write changes to.

    https://docs.couchdb.org/en/latest/maintenance/backups.html

    You literally send a POST request to your CouchDB instance telling it where to replicate to, and it Works(tm)

    EDIT: You can just cp out the .couch files in the data directory from under the running database as long as you can accept the I/O hit.