{"id":31721558,"url":"https://github.com/aero25x/redis-rdb-convert","last_synced_at":"2025-10-09T04:00:03.611Z","repository":{"id":318161489,"uuid":"1070198986","full_name":"Aero25x/redis-rdb-convert","owner":"Aero25x","description":"Python-based Redis RDB parser that converts Redis dump.rdb files to JSON format. Perfect for migrating Redis data, backup analysis, or debugging Redis databases. Supports RDB version 12 (Redis 7.x) with full parsing of strings, lists, sets, sorted sets (ZSET), hashes, streams, and more. ","archived":false,"fork":false,"pushed_at":"2025-10-05T14:08:52.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T15:20:21.447Z","etag":null,"topics":["json-rdb","python-redis-rdb","rdb","rdb-convert","rdb-json","rdb-parser","rdb-python","redis-rdb"],"latest_commit_sha":null,"homepage":"https://t.me/hidden_coding","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aero25x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-05T13:22:44.000Z","updated_at":"2025-10-05T14:08:55.000Z","dependencies_parsed_at":"2025-10-09T00:45:56.513Z","dependency_job_id":null,"html_url":"https://github.com/Aero25x/redis-rdb-convert","commit_stats":null,"previous_names":["aero25x/redis-rdb-convert"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Aero25x/redis-rdb-convert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aero25x%2Fredis-rdb-convert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aero25x%2Fredis-rdb-convert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aero25x%2Fredis-rdb-convert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aero25x%2Fredis-rdb-convert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aero25x","download_url":"https://codeload.github.com/Aero25x/redis-rdb-convert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aero25x%2Fredis-rdb-convert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000696,"owners_count":26082911,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["json-rdb","python-redis-rdb","rdb","rdb-convert","rdb-json","rdb-parser","rdb-python","redis-rdb"],"created_at":"2025-10-09T03:59:58.103Z","updated_at":"2025-10-09T04:00:03.600Z","avatar_url":"https://github.com/Aero25x.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis RDB to JSON Converter\n\n[![Join our Telegram RU](https://img.shields.io/badge/Telegram-RU-03A500?style=for-the-badge\u0026logo=telegram\u0026logoColor=white\u0026labelColor=blue\u0026color=red)](https://t.me/hidden_coding)\n[![Join our Telegram ENG](https://img.shields.io/badge/Telegram-EN-03A500?style=for-the-badge\u0026logo=telegram\u0026logoColor=white\u0026labelColor=blue\u0026color=red)](https://t.me/hidden_coding_en)\n[![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/aero25x)\n[![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge\u0026logo=x\u0026logoColor=white)](https://x.com/aero25x)\n[![YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge\u0026logo=youtube\u0026logoColor=white)](https://www.youtube.com/@flaming_chameleon)\n[![Reddit](https://img.shields.io/badge/Reddit-FF3A00?style=for-the-badge\u0026logo=reddit\u0026logoColor=white)](https://www.reddit.com/r/HiddenCode/)\n\n\nA lightweight, **Python-based Redis RDB parser** that converts **Redis dump.rdb files** to **JSON format**. Perfect for **migrating Redis data**, **backup analysis**, or **debugging Redis databases**. Supports **RDB version 12 (Redis 7.x)** with full parsing of strings, lists, sets, sorted sets (ZSET), hashes, streams, and more. SEO-optimized for developers searching for \"Redis RDB to JSON converter\" or \"parse Redis RDB file\".\n\n[![GitHub stars](https://img.shields.io/github/stars/aero25x/redis-rdb-convert?logo=github\u0026style=flat-square)](https://github.com/aero25x/redis-rdb-convert/stargazers)\n[![Python Version](https://img.shields.io/badge/python-3.7%2B-blue?logo=python\u0026style=flat-square)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n[![Issues](https://img.shields.io/github/issues/aero25x/redis-rdb-convert?color=red\u0026style=flat-square)](https://github.com/aero25x/redis-rdb-convert/issues)\n\n## 🚀 Quick Start\n\nTransform your Redis RDB dump into searchable JSON in seconds:\n\n```bash\n# Without Redis\npip install -r requirements.txt  # Optional: for LZF decompression\npython rdb_parser.py dump.rdb output.json --pretty --simple\n\n# With Redis Server - make sure you have backup.rdb file\ndocker-compose up -d\npython3 export_from_redis.py output.json\n```\n\nOutput example (simplified JSON):\n```json\n{\n  \"keys\": {\n    \"user:123\": \"John Doe\",\n    \"cart:456\": [\"item1\", \"item2\"],\n    \"scores\": [{\"member\": \"alice\", \"score\": 95.5}]\n  }\n}\n```\n\n## 🌟 Key Features\n\n- **Full RDB Parsing**: Handles **Redis RDB version 12** (Redis 7.x) including legacy formats like ziplists, quicklists, and listpacks.\n- **Data Types Supported**:\n  - Strings (with LZF compression support)\n  - Lists (ziplist, quicklist)\n  - Sets (intset, listpack)\n  - Sorted Sets (ZSET, ziplist/listpack encoded)\n  - Hashes (ziplist, listpack)\n  - Streams (simplified parsing)\n- **Metadata Extraction**: Captures expiry times, idle/frequency counters, DB selection, and AUX fields.\n- **Flexible Output**: \n  - **Simple mode**: Raw values only.\n  - **Full mode**: Includes type, expiry, and timestamps.\n- **Error-Resilient**: Skips invalid entries, handles binary data gracefully, and logs warnings.\n- **SEO-Friendly**: Optimized for searches like \"convert Redis RDB to JSON\", \"Redis backup parser Python\", \"RDB dump analyzer\".\n- **Lightweight**: No heavy dependencies (optional `python-lzf` for compression).\n\n## 📦 Installation\n\n1. **Clone the Repo**:\n   ```bash\n   git clone https://github.com/aero25x/redis-rdb-convert.git\n   cd redis-rdb-convert\n   ```\n\n2. **Install Dependencies** (Python 3.7+ required):\n   ```bash\n   pip install python-lzf  # Optional: For LZF decompression of strings\n   ```\n\n3.1. **Run the Parser Offline**:\n   ```bash\n   python rdb_parser.py /path/to/dump.rdb [output.json] [--pretty] [--simple]\n   ```\n3.2. **Run the Parser with Redis Server**:\n   ```bash\n   docker-compose up -d\n   python3 export_from_redis.py output.json\n   ```\n\n\n\n## 📖 Usage Examples\n\n### Basic Conversion\nConvert a full RDB dump to pretty-printed JSON:\n```bash\npython rdb_parser.py backup.rdb --pretty\n```\n*Output*: Prints JSON to stdout with full metadata (e.g., expiry dates in ISO format).\n\n### Simple Values Only\nExtract just key-value pairs (no metadata):\n```bash\npython rdb_parser.py dump.rdb output.json --simple\n```\n\n### Advanced: Parse Specific DB\nThe parser auto-detects DB changes via `SELECTDB` opcodes. For multi-DB dumps, all data is consolidated under the last DB (customize in code if needed).\n\n### Programmatic Use\n```python\nfrom rdb_parser import RDBParser\n\nparser = RDBParser('dump.rdb', simple_format=True)\nresult = parser.parse()\nprint(json.dumps(result['keys'], indent=2))\n```\n\n## 🔍 Supported RDB Structures\n\n| RDB Type | Encoding | Description | Example Output |\n|----------|----------|-------------|----------------|\n| **String** | Raw/LZF/Int | Basic key-value | `\"value\"` |\n| **List** | Ziplist/Quicklist | Ordered array | `[\"item1\", \"item2\"]` |\n| **Set** | Intset/Listpack | Unique members | `[\"a\", \"b\"]` |\n| **ZSET** | Ziplist/Listpack | Member-score pairs | `[{\"member\": \"alice\", \"score\": 95.5}]` |\n| **Hash** | Ziplist/Listpack | Field-value map | `{\"field1\": \"val1\"}` |\n| **Stream** | Listpacks | Entries (simplified) | `\"\u003cstream with N elements\u003e\"` |\n\n*Note*: Binary data is hex-encoded; large strings (\u003e100MB) are skipped for safety.\n\n## ⚠️ Limitations \u0026 Known Issues\n\n- **Compression**: LZF requires `python-lzf`; otherwise, compressed strings show as placeholders.\n- **Streams**: Basic support—full consumer groups not parsed.\n- **Very Large Files**: Memory-intensive for GB-scale RDBs; process in chunks if needed.\n- **Older Versions**: Optimized for RDB v12; test with v5-v11 for compatibility.\n- **No Modules**: Skips Redis Modules (TYPE_MODULE).\n\nFor issues like \"RDB parse error\" or \"ziplist decoding failed\", check stderr logs or open an issue.\n\n## 🤝 Contributing\n\nLove this **Redis RDB converter**? Help make it better!\n\n1. Fork the repo.\n2. Create a feature branch (`git checkout -b feature/amazing-feature`).\n3. Commit changes (`git commit -m 'Add amazing feature'`).\n4. Push to branch (`git push origin feature/amazing-feature`).\n5. Open a Pull Request.\n\n**Guidelines**: Add tests for new encodings, update `parse_ziplist` for edge cases. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## 📄 License\n\nThis **Redis RDB to JSON parser** is MIT-licensed. See [LICENSE](LICENSE) for details.\n\n## 📊 Related Tools\n\n- [rdbtools](https://github.com/sripathikrishnan/redis-rdb-tools): C-based alternative.\n- [redis-dump-go](https://github.com/nborwankar/redis-dump-go): Go implementation.\n- Searching for \"Redis RDB recovery\" or \"migrate Redis to JSON\"? This tool fits perfectly!\n\n---\n\n**Keywords**: Redis RDB parser, RDB to JSON, Redis dump converter, parse Redis backup, Redis 7 RDB, ziplist decoder, listpack parser.\n\n*Built with ❤️ for Redis devs. Star ⭐ if it saves your day!*\n\n\n[![Join our Telegram RU](https://img.shields.io/badge/Telegram-RU-03A500?style=for-the-badge\u0026logo=telegram\u0026logoColor=white\u0026labelColor=blue\u0026color=red)](https://t.me/hidden_coding)\n[![Join our Telegram ENG](https://img.shields.io/badge/Telegram-EN-03A500?style=for-the-badge\u0026logo=telegram\u0026logoColor=white\u0026labelColor=blue\u0026color=red)](https://t.me/hidden_coding_en)\n[![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/aero25x)\n[![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge\u0026logo=x\u0026logoColor=white)](https://x.com/aero25x)\n[![YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge\u0026logo=youtube\u0026logoColor=white)](https://www.youtube.com/@flaming_chameleon)\n[![Reddit](https://img.shields.io/badge/Reddit-FF3A00?style=for-the-badge\u0026logo=reddit\u0026logoColor=white)](https://www.reddit.com/r/HiddenCode/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faero25x%2Fredis-rdb-convert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faero25x%2Fredis-rdb-convert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faero25x%2Fredis-rdb-convert/lists"}