Redis Upgrade

Upgrading or Restarting a Redis Instance Without Downtime

Redis is designed to be a long-running server process. You can change many configuration options at runtime with the CONFIG SET command, and you can also switch from AOF to RDB snapshot persistence (or the other way around) without a restart. See the output of CONFIG GET * for more information.

Sometimes a restart is still required—for example, to upgrade the Redis process to a newer version, or to change a parameter that the CONFIG command does not currently support.

Follow these steps to avoid downtime:

  1. Set up the new Redis instance as a replica of the current one. For this you need either a different server, or a server with enough memory to run both Redis instances at the same time.
  2. If you use a single server, make sure the replica starts on a different port than the master, otherwise the replica will not start.
  3. Wait for the initial replication sync to finish, and check the replica’s log file.
  4. Use the INFO command to confirm the master and replica have the same number of keys; use redis-cli to verify the replica works as expected and responds to your commands.
  5. Use CONFIG SET slave-read-only no to allow writes to the replica.
  6. Point all clients at the new instance (the replica). During the switchover you may want to use CLIENT PAUSE so no client can write to the old master.
  7. Once you confirm the master receives no more queries (you can check with the MONITOR command), use REPLICAOF NO ONE to promote the replica to master, then shut down the old master.

If you use Redis Sentinel or Redis Cluster, the easiest way to upgrade to a new version is to upgrade the replicas one at a time. Then perform a manual failover to promote one of the upgraded replicas to master, and finally upgrade the last replica.


Reference: Redis Upgrade