Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8b564ad
inline and binary attachments can be downloaded and restored
mickeyze Sep 2, 2014
fb6becd
removing temp files
mickeyze Sep 2, 2014
b519071
removing temp lines
mickeyze Sep 3, 2014
76f1f91
if binary attachments is used, then inline is turned off by default
mickeyze Sep 3, 2014
f487f4d
restore script changed - file by file upload functionality
mickeyze Sep 6, 2014
41233c3
removing testing lines
mickeyze Sep 6, 2014
32a4147
status line fixed
mickeyze Sep 6, 2014
8e8157f
memory limit removed
mickeyze Sep 10, 2014
167a861
Merge pull request #1 from mickeyze/master
Sep 10, 2014
d380215
usage examples added to readme
Sep 11, 2014
169b7b1
Fix formatting
Sep 11, 2014
582bed5
Typo
Sep 11, 2014
92b5714
fixing urlencode bugs
mickeyze Feb 1, 2015
fc9a3e6
remove temp code
mickeyze Feb 1, 2015
0b88986
fixing json_encode/decode problems with brackets
mickeyze Feb 2, 2015
3121e1b
saving each record to separate file
mickeyze Feb 3, 2015
7ab3a9b
implementation of -s (separate files from current folder) and -p (Pre…
mickeyze Feb 11, 2015
5aba5a5
implementing -t, -P, -s option
mickeyze Feb 16, 2015
01ff163
fixing some bugs with restore function
mickeyze Feb 22, 2015
b926565
typo fix
mickeyze Feb 27, 2015
ffa0d5a
multiprocessing dump.php
mickeyze Jun 24, 2015
c35d35b
urlecnode included in database name
mickeyze Jul 15, 2015
79d2ef7
added option -z
mickeyze Jul 16, 2015
3f8f70a
urlecnode databasename
mickeyze Jul 16, 2015
3cf2887
fixing root folder title
mickeyze Jul 16, 2015
a322b33
-m option improved
mickeyze Jul 16, 2015
ef4f11e
-m option improved
mickeyze Jul 16, 2015
b3c9ef3
multiprocessing thread limit
mickeyze Jul 17, 2015
c4ab107
choudchdb-restore script now supports decompress and multiprocess opt…
mickeyze Jul 18, 2015
002ab98
adding empty database in archive
mickeyze Jul 19, 2015
71524a4
24h gmdate format
mickeyze Jul 20, 2015
9f2d868
Merge pull request #2 from mickeyze/master
Aug 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 41 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,51 @@
CouchDB Dump/Restore Tools
==========================
###PHP-based CouchDB Dump/Restore Utility

PHP scripts to dump and restore CouchDB databases.
This tool was originally authored by [Anton Bondar](https://github.com/zebooka). Additional work to support inline base64 attachements was sponsored by [CloudPBX Inc.](http://cloudpbx.ca) and authored by [Miralem Mehic](https://github.com/mickeyze).

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.

Reason, why I written them
--------------------------
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.

Because I found no usable and available tools to dump Couch databases, including history revisions, if needed.
Rerence on CouchDB's `/_all_docs` function [here ](http://docs.couchdb.org/en/latest/api/database/bulk-api.html)

###Usage for BACKUP with `couchdb-dump.php`

Why on PHP?
-----------
#####Basic Example:

Why not? This is just scripting language. I know it. If you would like, you can write your one scripts, for example on Python, with all bells and whistles, with blackjack and hookers.
`couchdb-dump.php -H localhost -p 5984 -d test > dump.json`

#####Attachment Example:

Usage
-----
`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).

Just run each script with -h flag and read help.
Loading