GithubHelp home page GithubHelp logo

isabella232 / pouchdb-dump-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pouchdb-community/pouchdb-dump-cli

0.0 0.0 0.0 24 KB

Command-line tool for dumping a CouchDB/PouchDB database to a file

License: Apache License 2.0

JavaScript 100.00%

pouchdb-dump-cli's Introduction

PouchDB Dump CLI

Dump a PouchDB or CouchDB database to a file, or to multiple files. Then you can load it into another PouchDB or CouchDB database.

When you do so, it will be as if you had replicated from one database to the other, but without all the standard HTTP chattiness of the CouchDB protocol.

In other words, this is a very fast way to do initial replication. And it's also safe to do multiple times, since the "load" operation is idempotent.

To load the dump file, use pouchdb-load.

To dump from within your JavaScript code (either in Node.js or in the browser), just use pouchdb-replication-stream directly.

Usage

To install:

$ npm install -g pouchdb-dump-cli

To dump a CouchDB:

$ pouchdb-dump http://localhost:5984/mydb > dump.txt

To dump a LevelDB-based PouchDB:

$ pouchdb-dump /path/to/my/db > dump.txt

Full usage and examples:

Examples:
  pouchdb-dump http://localhost:5984/mydb > dump.txt                             Dump from the "mydb" CouchDB to dump.txt
  pouchdb-dump /path/to/mydb > dump.txt                                          Dump from the "mydb" LevelDB-based PouchDB to dump.txt
  pouchdb-dump /path/to/mydb -o dump.txt                                         Dump to the specified file instead of stdout
  pouchdb-dump /path/to/mydb -o dump.txt -s 100                                  Dump every 100 documents to dump_00.txt, dump_01.txt, dump_02.txt, etc.
  pouchdb-dump http://example.com/mydb -u myUsername -p myPassword > dump.txt    Specify a CouchDB username and password if it's protected


Options:
  -h, --help         this help message                                    
  -o, --output-file  output file (else will dump to stdout)               
  -u, --username     username for the CouchDB database (if it's protected)
  -p, --password     password for the CouchDB database (if it's protected)
  -s, --split        split into multiple files, for every n docs 

Changelog

2.0.0

2.0.0 is a breaking change that increases the default batch size for non-split dumps from 1 to 100. This makes the out-of-the-box performance of this tool much beter. You can still get one-doc-per-line if you set the --split to 1.

I doubt anybody actually wants that, but I'm still incrementing the major version.

Note: This does not break compatibility with pouchdb-load. pouchdb-load will still accept dumpfiles created with either 1.x or 2.x.

pouchdb-dump-cli's People

Contributors

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