Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

redis-dump

> 编程语言
Open source

Redis to JSON and back again

842 stars0 likes2 views
WebsiteGitHub

About

Redis to JSON and back again

Redis::Dump - v0.6.0

Redis to JSON and back again. Dump and load Redis databases to/from JSON files.

Installation

One of:

  1. Gemfile: gem 'redis-dump', '~> 0.4.0'
  2. Install manually: gem install redis-dump
  3. Clone with git: git clone [email protected]:delano/redis-dump.git

Usage

There are two executables: redis-dump and redis-load.

bash
  $ redis-dump
  $ redis-dump -u 127.0.0.1:6379 > db_full.json
  $ redis-dump -u 127.0.0.1:6379 -d 15 > db_db15.json

  $ :
  # Note the leading colon is important for specifying no username.
  $ redis-dump -u :[email protected]:9055

Output format

All redis datatypes are output to a simple JSON object. All objects have the following 5 fields:

  • db (Integer)
  • key (String)
  • ttl (Integer): The amount of time in seconds that the key will live. If no expire is set, it's -1.
  • type (String), one of: string, list, set, zset, hash, none.
  • value (String): A JSON-encoded string. For keys of type list, set, zset, and hash, the data is given a specific structure (see below).

Here are examples of each datatype:

…

Important notes

About TTLs

One of the purposes of redis-dump is the ability to restore the database to a known state. When you restore a redis database from a redis-dump file, the expires are reset to their values at the time the dump was created. This is different from restoring from Redis' native .rdb or .aof files (expires are stored relative to the actual time they were set).

Output directly to an encrypted file

For most sensitive data, you should consider encrypting the data directly without writing first to a temp file. You can do this using the power of gpg and file descriptors. Here are a couple examples:

bash
  # Encrypt the data (interactive)
  $ redis-dump -u 127.0.0.1:6379 -d 15 | gpg --force-mdc -v -c > path/2/backup-db1

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/delano/redis-dump.

License

The gem is available as open source under the terms of the MIT License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言