kikinteractive/couchbase-dump

Name: couchbase-dump

Owner: Kik Interactive

Description: Helpful scripts for dumping and recreating couchbase buckets and views

Created: 2016-04-03 14:03:31.0

Updated: 2017-02-27 06:53:58.0

Pushed: 2016-11-22 12:03:06.0

Homepage: null

Size: 9

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

couchbase-dump

Helpful scripts for dumping and recreating couchbase buckets and views

Dump all your couchbase buckets and views as javascript files in a directory hierarchy that you can commit to your repo. Then you can recreate the couchbase buckets and views from previously dumped data.

The scripts use standard python libraries and have no dependencies.

general usage

Dump your production couchbase like so:

_couchbase.py Administrator Password couchbase.example.com:8091 couchbase_buckets

Then create the couchbase buckets on a new couchbase instance

te_couchbase.py Administrator Password couchbase.example.com:8091 couchbase.example.com:8092 couchbase_buckets

docker usage

Given is an example docker-compose.yml and init_couchbase_image.sh script for creating a new couchbase instance. The script waits for the couchbase instance to load, as it may take a while, and then initializes it to a default username and password and runs create_couchbase.py.

usage

if you have just ran dump_couchbase.py as describe above, run the following to create your couchbase image: docker-compose run init-couchbase

cleanup

remove the couchbase and data created by docker-compose docker-compose stop; docker-compose rm -f

tip

its usually a lot simply to write the views using couchbase UI - and then dump it into a file with the dumpscript. This is especially true when your view uses the built-in reduce function.

Soon


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.