Skip to content

Instantly share code, notes, and snippets.

@mbchoa
Created January 19, 2025 03:10
Show Gist options
  • Save mbchoa/601e103da4ff291d3678d38a677d0fe8 to your computer and use it in GitHub Desktop.
Save mbchoa/601e103da4ff291d3678d38a677d0fe8 to your computer and use it in GitHub Desktop.
Copy data from one Redis instance to another
redis-cli -u redis://default:pass@host:port --scan | while read key; do
value=$(redis-cli -u redis://default:pass@host:port get "$key")
redis-cli -u redis://default:default@host set "$key" "$value"
echo "Copied key: $key"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment