RedisDump 2.1.0

dotnet tool install --global RedisDump --version 2.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local RedisDump --version 2.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=RedisDump&version=2.1.0
                    
nuke :add-package RedisDump --version 2.1.0
                    

Redis Dump Tool

A .NET command-line tool for dumping and restoring Redis data.

Installation

# Install globally
dotnet tool install --global RedisDump

# Install locally in the current directory
dotnet tool install --local RedisDump

Usage

Dump Redis Data

Dump all data from Redis to a file:

redis-dump dump --connection "localhost:6379" --output "redis-backup.json"

Dump a specific database:

redis-dump dump --connection "localhost:6379" --database 0 --output "redis-backup.json"

Dump multiple databases:

redis-dump dump --connection "localhost:6379" --database 0 --database 1 --database 2 --output "redis-backup.json"

Options:

  • -c, --connection <CONNECTION_STRING>: Redis connection string (default: localhost:6379)
  • -d, --database <DATABASE_NUMBERS>: Redis database numbers to process (can be specified multiple times). If not specified, all databases will be processed.
  • -o, --output <FILE>: Output file path (default: redis-dump.json)
  • -b, --batch-size <SIZE>: Number of keys to process in a single Lua batch (default: 100)
  • --verbose: Show verbose output

Restore Redis Data

Restore data from a file to Redis:

redis-dump restore --connection "localhost:6379" --input "redis-backup.json"

Restore to a specific database:

redis-dump restore --connection "localhost:6379" --database 0 --input "redis-backup.json"

Restore to multiple databases:

redis-dump restore --connection "localhost:6379" --database 0 --database 1 --database 2 --input "redis-backup.json"

Options:

  • -c, --connection <CONNECTION_STRING>: Redis connection string (default: localhost:6379)
  • -d, --database <DATABASE_NUMBERS>: Redis database numbers to process (can be specified multiple times). If not specified, all databases will be processed.
  • -i, --input <FILE>: Input file path (default: redis-dump.json)
  • --flush: Flush the database before restoring (requires --force)
  • -f, --force: Force restore even if database is not empty
  • --verbose: Show verbose output

Features

  • Dumps and restores all Redis data types (string, list, set, sorted set, hash)
  • Preserves TTL values
  • Supports multiple databases
  • Beautiful console output with progress bars
  • JSON preview with verbose mode
  • Authentication support with password
  • Batch processing for improved performance

Example

# Dump all Redis data
redis-dump dump --connection "redis-server:6379,password=mypassword,ssl=true" --output "backup.json" --verbose --batch-size 200

# Restore data to a new Redis server
redis-dump restore --connection "new-redis-server:6379,password=newpassword,allowAdmin=true" --input "backup.json" --flush --force

Connection String Format

The connection string format follows the StackExchange.Redis format:

server:port,option1=value1,option2=value2

Common options:

  • password=secret: Redis password
  • ssl=true: Enable SSL
  • allowAdmin=true: Allow commands that might be considered risky

See https://stackexchange.github.io/StackExchange.Redis/Configuration for full details

Development

Building from Source

git clone https://github.com/yourusername/RedisDump.git
cd RedisDump
dotnet build

Creating and Installing the Tool Locally

dotnet pack
dotnet tool install --global --add-source ./RedisDump/nupkg RedisDump

License

MIT

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
2.1.0 113 3/28/2025
2.1.0-ci0002 103 3/28/2025
2.0.1-ci0001 106 3/28/2025
2.0.0 108 3/27/2025
1.2.0 109 3/27/2025
1.1.1 119 3/27/2025
1.1.0 112 3/26/2025
0.2.0 109 3/27/2025
0.2.0-ci0022 115 3/27/2025
0.1.0 115 3/26/2025