Redis

Table of contents:

Usage

Show DBs

info keyspace

Select db

select {number}

Get keys

keys *

Get the type of the key

type keyname

Get details of the key

if value type is:

Delete keys matching the pattern

redis-cli --scan --pattern '*mypattern*' | xargs redis-cli del

Migration

Clone / dump / restore

Use rump to do all:

rump -from redis://redis_addr:redis_port/db_number -to redis://redis_addr:redis_port/db_number
# or -to/-from redisdb.dump if you want to use files

Management

Change settings without restarting

Might not be possible for all options, but docs are good. Example seting the maxmemory value to 4GB:

CONFIG SET maxmemory 4294967296