Created
April 14, 2015 06:08
-
-
Save rizkyabdilah/e59c57413b36ecfaccdf to your computer and use it in GitHub Desktop.
redis move keys
This file contains 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
local kys = redis.call('KEYS', '*') | |
for _, key in ipairs(kys) do | |
redis.call('MIGRATE', 'dst_host', 'dst_port', key, 'dst_db', 1000, 'replace') | |
end | |
return 1 | |
// one line eval | |
eval "local kys = redis.call('KEYS', '*') for _, key in ipairs(kys) do redis.call('MIGRATE', 'dst_host', 'dst_port', key, 'dst_db', 1000, 'replace') end; return 1" 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment