Skip to content

Instantly share code, notes, and snippets.

@2743d2
2743d2 / copy_redis_key.sh
Last active September 13, 2023 03:19 — forked from ZwodahS/copy_redis_key.sh
copy a redis db key to another place (use MIGRATE COPY for v3.0<= redis)
#!/bin/bash
# source http://stackoverflow.com/questions/23222616/copy-all-keys-from-one-db-to-another-in-redis
#set connection data accordingly
source_host=localhost
source_port=6379
source_db=1
target_host=localhost
target_port=6379
target_db=2