Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adrienverge/coucharchive
Create and restore backups of a whole CouchDB server, with simple tar.gz files
https://github.com/adrienverge/coucharchive
Last synced: 17 days ago
JSON representation
Create and restore backups of a whole CouchDB server, with simple tar.gz files
- Host: GitHub
- URL: https://github.com/adrienverge/coucharchive
- Owner: adrienverge
- License: mit
- Created: 2016-09-26T13:33:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T20:43:51.000Z (over 3 years ago)
- Last Synced: 2024-10-03T15:53:06.969Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 89.8 KB
- Stars: 14
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - adrienverge/coucharchive - Create and restore backups of a whole CouchDB server, with simple tar.gz files (others)
README
coucharchive
============Use coucharchive to create and restore backups of a whole CouchDB server /
cluster of servers, or to simply replicate it to another server / cluster.Backup archives are saved as single tar.gz file, and can be imported later to
any other CouchDB server.Useful for making backups, or replicating your database to a secondary test
environment.Installation
------------Using pip:
.. code:: bash
$ pip3 install --user coucharchive
Examples
--------Make a backup archive from a running server:
.. code:: bash
$ coucharchive create --from http://root:[email protected]:5984 \
--output test.tar.gzRestore this archive to another server:
.. code:: bash
$ coucharchive restore --to http://other-server.com:5984 \
--input test.tar.gzSimply load a backup in a temporary CouchDB server:
.. code:: bash
$ coucharchive load -i test.tar.gz
Launched CouchDB instance at http://root:L76mqQE5fE@localhost:38095Replicate from a CouchDB installation to another one:
.. code:: bash
$ coucharchive replicate --from http://[email protected]:5984 \
--to http://[email protected]:5984Slow down replication (to decrease servers load) so that it runs in one hour:
.. code:: bash
$ coucharchive replicate --from http://[email protected]:5984 \
--to http://[email protected]:5984 \
--ideal-duration 3600Don't pass credentials on the command line:
.. code:: bash
$ coucharchive create --from private.server.com:5984 -o test.tar.gz
CouchDB admin for private.server.com: root
CouchDB password for [email protected]: p4ssHow do archives work?
---------------------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 replicates to your remote CouchDB server.Go further
----------For repetitive backups, you can use a config file:
.. code:: bash
$ cat config.ini
[source]
url = http://root:password@my-server:5984[replication]
ignore_dbs = db_to_ignore, other_useless_db$ coucharchive -c config.ini create -o test.tar.gz
To save a backup on AWS S3 and notify somebody via email:
.. code:: bash
$ aws s3 cp /tmp/archive.tar.gz s3://my-backups/archive.tar.gz
$ cat >/tmp/email.txt <