Created
June 22, 2021 15:25
-
-
Save itsjwala/0e26a3c01772fb4c2f6d0d0a032e4f6d to your computer and use it in GitHub Desktop.
redis cli migrate keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use if keys are less, check redis metrics when this is done. | |
# "migrate" copies keys with TTL | |
redis-cli -h HOST1 -p 6398 keys \* | xargs -I '{}' -P 100 redis-cli -h HOST1 -p 6398 migrate HOST2 6398 "" 0 5000 COPY KEYS '{}' | |
# for lots of keys use SCAN to get keys in batches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment