Coder Social home page Coder Social logo

couchdb-dump-php's Introduction

###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:

  • -h Display this help message.
  • -e Turn 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.
  • -a Fetch attachments inline (capture them in base64 encoded format).
  • -X No revisions history in dump.
  • -A Fetch 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:

  • -h Display this help message.
  • -e Turn 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.
  • -D Drop and create database, if needed (default: create db, only if it does not exist).
  • -F Force restore on existing DB with documents.
  • -a Restore inline attachments (from base64 encoded format).

couchdb-dump-php's People

Contributors

mickeyze avatar zebooka avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.