Skip to main content

Dump/restore a whole CouchDB server contents to/from a single tar.gz file.

Project description

Dump/restore a whole CouchDB server contents to/from a single tar.gz file.

Useful for making backups, or replicating your database to a secondary test environment.

Installation

Using pip:

sudo pip3 install coucharchive

How it works?

coucharchive spawns a local CouchDB instance locally, using a temporary directory for storing data and configuration.

When dumping, it replicates your source CouchDB server (i.e. replicates all dbs, including _users) to the fresh local one, then saves and compresses its data to a tar.gz archive.

When loading, it uncompresses the archive, has the local CouchDB instance use it as its data, then replicated to your remote CouchDB server.

Examples

Set-up the database server info in config.ini:

[database] url = http://my-server.com:5984 username = root password = p4ss

Dumping database to a file:

coucharchive -c config.ini dump -o /tmp/coucharchive.tar.gz

Restoring database from an archive:

coucharchive -c config.ini load -i /tmp/coucharchive.tar.gz

Go further

For instance, save a backup to S3 and notify somebody via email:

aws s3 cp /tmp/archive.tar.gz s3://my-backups/archive.tar.gz cat >/tmp/email.txt <<EOM Subject: New backup saved on S3

A CouchDB backup called archive.tar.gz was successfully created and pushed on Amazon S3. EOM sendmail user@example.com </tmp/email.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for coucharchive, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size coucharchive-1.0.2.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page