Skip to content

Instantly share code, notes, and snippets.

@sonirico
Created October 27, 2024 23:41
Show Gist options
  • Save sonirico/be848d2451973cc065f9affbd6a7916e to your computer and use it in GitHub Desktop.
Save sonirico/be848d2451973cc065f9affbd6a7916e to your computer and use it in GitHub Desktop.
redis dump minimal script
#!/usr/bin/env bash
REDIS_SOURCE_PORT=2222
redis-cli -p $REDIS_SOURCE_PORT --scan | while read -r key; do
redis-cli -p $REDIS_SOURCE_PORT -D "" --raw dump "$key" > key.dump ;
redis-cli -X dump_tag restore $key 0 dump_tag replace < key.dump
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment