Giter Site home page Giter Site logo

couchdb-dump's Introduction

Couchdb-dump (& restore)

It works on LINUX/UNIX, Bash based systems (MacOSx)

Bash command line script(s) to EASILY dump&restore a couchdb database

  • Needs bash
  • Dumped database is outputted into stdout (screen)

##Quickstart (& quickend) Dump: bash couchdb-dump.sh mycouch.com my-db > dumped-db.txt

Restore: bash couchdb-restore.sh mycouch.com my-db dumped-db.txt

##Quickstart (& quickend) with user & pass Dump: bash couchdb-dump.sh user:[email protected] my-db > dumped-db.txt

Restore: bash couchdb-restore.sh user:[email protected] my-db dumped-db.txt

Why do you need it?

Surprisingly there is not a straightforward way to dump a couchdb database. Often you are suggested to replicate it or to dump it with the couchdb _all_docs directive.

But using _all_docs directive you have as output a JSON object which cannot be used to directly re-upload the database to couchdb.

Hence, the goal of this script(s) is to give you a simple way to download & upload your couchdb database.

DUMP Usage

When launched it takes as arguments:

  • url of database (without http://)
  • database name

Just write in the command line:

bash couchdb-dump DB_URL... DB_NAME...

DB_URL: the url of the couchdb instance without 'http://', e.g. mycouch.com

DB_NAME: name of the database, e.g. 'my-db'

Example

bash couchdb-dump.sh mycouch.com my-db

Saving output to file

bash couchdb-dump.sh mycouch.com my-db > dumped-db.txt

RESTORE usage

When launched it takes as arguments:

  • url of database (without http://) NB: if log-in is enabled the url is like user:[email protected]
  • database name
  • file containing dumped database

Just write in the command line:

bash couchdb-restore.sh URL... DB_NAME... DUMPED_DB_FILENAME...

DB_URL: the url of the couchdb instance without 'http://', e.g. mycouch.com

DB_NAME: name of the database, e.g. 'my-db'

DUMPED_DB_FILENAME... : file containing the JSON object with all the docs

Example

bash couchdb-restore.sh user:[email protected] my-db dumpedDB.txt

TODO

Add -p option to use an arbitrary port (5984 is the default one)

couchdb-dump's People

Contributors

danielebailo avatar epos-eu avatar

Watchers

 avatar  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.