{"id":13746828,"url":"https://github.com/delano/redis-dump","last_synced_at":"2025-05-14T12:11:26.180Z","repository":{"id":1182830,"uuid":"1082997","full_name":"delano/redis-dump","owner":"delano","description":"Redis to JSON and nack again","archived":false,"fork":false,"pushed_at":"2024-10-28T18:32:23.000Z","size":2180,"stargazers_count":831,"open_issues_count":16,"forks_count":126,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-04-28T10:57:43.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/redis-dump","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delano.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-11-15T20:11:34.000Z","updated_at":"2025-04-21T18:04:09.000Z","dependencies_parsed_at":"2024-11-07T18:01:03.769Z","dependency_job_id":"21c835ca-b680-4725-8717-c376dff8b838","html_url":"https://github.com/delano/redis-dump","commit_stats":{"total_commits":64,"total_committers":8,"mean_commits":8.0,"dds":0.265625,"last_synced_commit":"89131aaf215e8001de9606494466d94d9681e8e6"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delano%2Fredis-dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delano%2Fredis-dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delano%2Fredis-dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delano%2Fredis-dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delano","download_url":"https://codeload.github.com/delano/redis-dump/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254140766,"owners_count":22021220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T06:01:02.451Z","updated_at":"2025-05-14T12:11:26.121Z","avatar_url":"https://github.com/delano.png","language":"Ruby","funding_links":[],"categories":["Ruby","Higher level libraries and tools"],"sub_categories":[],"readme":"# Redis::Dump - v0.6.0\n\n*Redis to JSON and back again. Dump and load Redis databases to/from JSON files.*\n\n\n## Installation\n\nOne of:\n1. Gemfile: `gem 'redis-dump', '~\u003e 0.4.0'`\n2. Install manually: `gem install redis-dump`\n3. Clone with git: `git clone git@github.com:delano/redis-dump.git`\n\n\n\n## Usage\n\nThere are two executables: `redis-dump` and `redis-load`.\n\n```bash\n  $ redis-dump\n  $ redis-dump -u 127.0.0.1:6379 \u003e db_full.json\n  $ redis-dump -u 127.0.0.1:6379 -d 15 \u003e db_db15.json\n\n  $ \u003c db_full.json redis-load\n  $ \u003c db_db15.json redis-load -d 15\n  # OR\n  $ cat db_full | redis-load\n  $ cat db_db15.json | redis-load -d 15\n\n  # You can specify the redis URI via an environment variable\n  $ export REDIS_URI=127.0.0.1:6379\n  $ redis-dump\n\n  # If your instance uses a password (such as on RedisToGo), you\n  # can specify the Redis URL as such:\n  # :\u003cpassword\u003e@\u003cdomain\u003e:\u003cport\u003e\n  # Note the leading colon is important for specifying no username.\n  $ redis-dump -u :234288a830f009980e08@example.redistogo.com:9055\n```\n\n### Output format\n\nAll redis datatypes are output to a simple JSON object. All objects have the following 5 fields:\n\n* db (Integer)\n* key (String)\n* ttl (Integer): The amount of time in seconds that the key will live. If no expire is set, it's -1.\n* type (String), one of: string, list, set, zset, hash, none.\n* value (String): A JSON-encoded string. For keys of type list, set, zset, and hash, the data is given a specific structure (see below).\n\nHere are examples of each datatype:\n\n```json\n{\"db\":0,\"key\":\"hashkey\",\"ttl\":-1,\"type\":\"hash\",\"value\":{\"field_a\":\"value_a\",\"field_b\":\"value_b\",\"field_c\":\"value_c\"},\"size\":42}\n{\"db\":0,\"key\":\"listkey\",\"ttl\":-1,\"type\":\"list\",\"value\":[\"value_0\",\"value_1\",\"value_2\",\"value_0\",\"value_1\",\"value_2\"],\"size\":42}\n{\"db\":0,\"key\":\"setkey\",\"ttl\":-1,\"type\":\"set\",\"value\":[\"value_2\",\"value_0\",\"value_1\",\"value_3\"],\"size\":28}\n{\"db\":0,\"key\":\"zsetkey\",\"ttl\":-1,\"type\":\"zset\",\"value\":[[\"value_0\",\"100\"],[\"value_1\",\"100\"],[\"value_2\",\"200\"],[\"value_3\",\"300\"],[\"value_4\",\"400\"]],\"size\":50}\n{\"db\":0,\"key\":\"stringkey\",\"ttl\":79,\"type\":\"string\",\"value\":\"stringvalue\",\"size\":11}\n```\n\n## Important notes\n\n### About TTLs\n\nOne 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).\n\n### Output directly to an encrypted file\n\nFor 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](http://www.gnupg.org/) and file descriptors. Here are a couple examples:\n\n```bash\n  # Encrypt the data (interactive)\n  $ redis-dump -u 127.0.0.1:6379 -d 15 | gpg --force-mdc -v -c \u003e path/2/backup-db1\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/delano/redis-dump.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelano%2Fredis-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelano%2Fredis-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelano%2Fredis-dump/lists"}