https://github.com/appit-online/redis-dumper
Backup and Restore Redis Server - #TLS Support #Fast - CLI for parallel processing of redis migration tasks, copy and delete thousands of key within some minutes
https://github.com/appit-online/redis-dumper
go golang redis redis-backup redis-dump redis-exporter redis-migration
Last synced: 3 months ago
JSON representation
Backup and Restore Redis Server - #TLS Support #Fast - CLI for parallel processing of redis migration tasks, copy and delete thousands of key within some minutes
- Host: GitHub
- URL: https://github.com/appit-online/redis-dumper
- Owner: appit-online
- License: apache-2.0
- Created: 2021-12-12T00:59:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-17T14:17:54.000Z (11 months ago)
- Last Synced: 2025-03-01T08:12:03.346Z (3 months ago)
- Topics: go, golang, redis, redis-backup, redis-dump, redis-exporter, redis-migration
- Language: Go
- Homepage: https://github.com/appit-online/redis-dumper
- Size: 3.19 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redis-dumper CLI
Parallel processing through go routines, copy and delete thousands of key within some minutes- copy data by key pattern from one redis instance to another (backup/restore)
- delete keys from redis (e.g by key pattern)
- generate dummy keys## Installation
- Option A
- Download the binary for your platform from the [releases page](https://github.com/appit-online/redis-dumper/releases).
- Option B
- Checkout master and install locally with
- `go install`
- Option C
- Install with Homebrew
- ```
brew tap appit-online/redis-dumper https://github.com/appit-online/redis-dumper
brew install redis-dumper
```
- Option D
- Install with npm
- ```
npm i -g redis-dumper
```## Usage
*Source*, *destination* - can be provided as just `:` or in Redis URL format: `redis://[:@]:[/]`
*Pattern* - can be glob-style pattern supported by [Redis SCAN](https://redis.io/commands/scan) command.### 1) Migrate - Export/Import keys
```bash
redis-dumper migrate --pattern="prefix:*" --sourcePassword="SourcePassword" --targetPassword="TargetPassword"
```#### Other flags:
```bash
--logInterval int "Print current status every N seconds" (default 1)
--scanCount int "COUNT parameter for redis SCAN command" (default 1000)
--parallelDumps int "Number of parallel dump goroutines" (default 100)
--pushRoutines int "Number of parallel restore goroutines" (default 100)
--replaceExistingKeys bool "Existing keys will be replaced" (default false)
```### 2) Delete keys
```bash
redis-dumper delete --pattern="prefix:*" --password="Password"
```#### Other flags:
```bash
--logInterval int "Print current status every N seconds" (default 1)
--scanCount int "COUNT parameter for redis SCAN command" (default 1000)
--parallelDeletes int "Number of parallel delete goroutines" (default 100)
```### 3) Generate keys
```bash
redis-dumper generate --password="Password"
```#### Other flags:
```bash
--prefixes []string "List of prefixes for generated keys" (default {"mykey:", "testkey:"})
--prefixAmount []string "Amount of keys to create for each prefix in one iteration" (default {"1", "2"})
--entryCount int "Iteration count to perform" (default 1)
```## Migration Job Details
### Scanning
Is performed with a single goroutine, scanned keys are sent to channel### DUMPING
X export goroutines are consuming keys and perform `DUMP` and `PTTL` as a pipeline command### Restoring
Results are sent to another channel, where another Y push goroutines are performing `RESTORE`/`REPLACE` command on the destination instance### Monitoring
A goroutine outputs status every T seconds