###PHP-based CouchDB Dump/Restore Utility
This tool was originally authored by Anton Bondar. Additional work to support inline base64 attachements was sponsored by CloudPBX Inc. and authored by Miralem Mehic.
The original dump tool authored by zebooka included supported incremental backups. This made it much more feasible to add support to dump inline base64 attachements.
Although CouchDB's /_all_docs function is more popular with DB backups that don't include attachements, this function doesn't support attachments. To download attachments, individual documents must be accessed.
Rerence on CouchDB's /_all_docs function here
###Usage for BACKUP with couchdb-dump.php
#####Basic Example:
couchdb-dump.php -H localhost -p 5984 -d test > dump.json
#####Attachment Example:
couchdb-dump.php -X -a -H localhost -p 5984 -d test > dump.json
OPTIONS:
-hDisplay this help message.-eTurn php error reporting ON.-H <HOSTNAME>Hostname or IP of CouchDB server (default: 'localhost').-p <PORT>Port of CouchDB server (default: 5984).-d <DATABASE>Database to dump.-aFetch attachments inline (capture them in base64 encoded format).-XNo revisions history in dump.-AFetch attachments binary (Download them to current folder).-y <PHP_FILE>Include this PHP script that returns callback/function to check if document/revision needs to be dumped.
###Usage for RESTORE with couchdb-restore.php
#####Basic Example:
couchdb-restore.php -H localhost -p 5984 -d test -f dump.json
OPTIONS:
-hDisplay this help message.-eTurn php error reporting ON.-H <HOSTNAME>Hostname or IP of CouchDB server (default: 'localhost').-p <PORT>Port of CouchDB server (default: 5984).-d <DATABASE>Database to restore.-f <FILENAME>JSON file to restore.-DDrop and create database, if needed (default: create db, only if it does not exist).-FForce restore on existing DB with documents.-aRestore inline attachments (from base64 encoded format).