Skip to content

Instantly share code, notes, and snippets.

@rizkyabdilah
Created April 14, 2015 06:08
Show Gist options
  • Save rizkyabdilah/e59c57413b36ecfaccdf to your computer and use it in GitHub Desktop.
Save rizkyabdilah/e59c57413b36ecfaccdf to your computer and use it in GitHub Desktop.
redis move keys
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