Dump redis database into redis commands or json with command line or node.js

npm install redis-dump
1 downloads in the last day
5 downloads in the last week
38 downloads in the last month


Dump redis database into redis cli commands


Installing npm (node package manager)

  $ curl | sh

Installing redis-dump

  $ [sudo] npm install redis-dump -g

Note: If you are using redis-dump programatically you should not install it globally.

  $ cd /path/to/your/project
  $ [sudo] npm install redis-dump


There are two distinct ways to use redis-dump: through the command line interface, or by requiring the redis-dump module in your own code.

Using redis-dump from the command line

The usage options are simple:

  $ redis-dump --help
  Usage: redis-dump [OPTIONS]
    -h <hostname>  Server hostname (default:
    -p <port>    Server port (default: 6379)
    -f <filter>    Query filter (default: *)
    --help       Output this help and exit

    redis-dump -p 6500
    redis-dump -f 'mydb:*' > mydb.dump.txt

  The output is a valid list of redis commands.
  That means the following will work:
    redis-dump > dump.txt      # Dump redis database
    cat dump.txt | redis-cli   # Import redis database from generated file

Using redis-dump from node.js

You can also use redis-dump from inside your own node.js code.

  var dump = require('redis-dump');

    // These are default values, you can omit them
    filter: '*',
    port: 6379,
    host: ''
  function(err, result){
    // Do something with result
npm loves you