You must move a production Redis primary with one replica from 7.2 to 8.10 without downtime: which steps, commands and checks make up the upgrade?
answer
- new version joins as a replica
- match key counts before the switch
- pause writes, match offsets
- persist the promotion
- the way back is narrow
basics
~20 sUpgrade the replica to 8.10, let it sync and compare key counts, pause writes on the 7.2 primary with CLIENT PAUSE WRITE, match offsets, promote with REPLICAOF NO ONE, run CONFIG REWRITE, repoint clients, then upgrade the old node.
solid answer
~50 sFirst confirm the path: Redis 7.x, with or without modules, to Redis 8 is supported by replication or persistence, and the docs say to rehearse it. Back up, then bring 8.10 up as the replica: wait for the initial sync, see `master_link_status:up`, compare key counts with `INFO`, and try commands through `redis-cli`. To cut over, run `CLIENT PAUSE 30000 WRITE` on the old primary, wait until `slave_repl_offset` matches its `master_repl_offset`, promote with `REPLICAOF NO ONE`, repoint clients, and stop the old node before the pause expires, because queued writes run on it when the pause ends. `FAILOVER`, since 6.2, automates the pause and hand-off. Run `CONFIG REWRITE` on the new primary so a stale `replicaof` line cannot demote it at restart. Finally upgrade the old node and rejoin it as a replica, with a pre-upgrade backup as the documented way back.
code
bash · 13 lines# compare key counts, then check the replica link
redis-cli -h old-node INFO keyspace
redis-cli -h new-node INFO keyspace
redis-cli -h new-node INFO replication | grep -E 'master_link_status|slave_repl_offset'
# stop writes on the old primary and compare offsets
redis-cli -h old-node CLIENT PAUSE 30000 WRITE
redis-cli -h old-node INFO replication | grep master_repl_offset
redis-cli -h new-node INFO replication | grep slave_repl_offset
# promote, persist, then repoint clients and stop the old node
redis-cli -h new-node REPLICAOF NO ONE
redis-cli -h new-node CONFIG REWRITEgo deeper
Recall the shape: the new version joins as a replica, it catches up, clients move to it, and only then does the old node go away.
Explain each check: sync finished, link up, equal key counts, equal offsets. Know that CLIENT PAUSE WRITE queues writes and that REPLICAOF NO ONE does not change the file.
Run the cutover and its failure paths: a pause expiring on a live old primary, a stale replicaof line, missing module config, and no clean way back after the first write on 8.10.
Weigh the hand cutover against FAILOVER or Sentinel, and decide what evidence releases the go-ahead, including who approves the 7.2 to 8 licence change.
## What the procedure achieves A restart is the only way to change the Redis binary. The idea is to make the new version a **replica** of the old one, so it receives all the data, and then move clients to it. The Redis administration page documents this for both upgrades and restarts, and the Redis 8.0 release notes list upgrade paths by replication or persistence from previous versions and from Redis Stack 7.2 or 7.4. ## Before touching a node - **Rehearse.** The upgrade pages call practising in a controlled environment essential. - **Licence.** Redis 7.2 and earlier are BSDv3. Redis 8.0 onward is your choice of RSALv2, SSPLv1 or AGPLv3. That is a one-line check for whoever approves it. - **Modules.** Since 8.0 the query engine, JSON, time series and probabilistic types are part of Redis Open Source, and binary distributions include them. A source build with no module config does not have them, and an RDB holding module keys then aborts with `The RDB file contains module data I can't load`. - **Config.** A directive the new binary does not recognise stops startup, so start 8.10 on your real file in rehearsal. - **Backup.** The upgrade pages use `redis-cli SAVE` and copy the data directory. `SAVE` blocks clients, so run it on the replica or use `BGSAVE` on a node taking traffic. ## Bring up the new version 1. Install 8.10 on the replica's host and restart it, or start a new instance as a replica. A new instance on the same server needs enough RAM for both and a different port. 2. Wait for the initial synchronization to finish. Check the replica's log and `master_link_status:up` in `INFO replication`. 3. Use `INFO` to confirm that both nodes hold the same number of keys. 4. Use `redis-cli` to confirm the replica replies correctly. During this step the primary has no live copy if the replica was restarted in place, so keep the step short. ## Cut over Redis documents three ways to do this. | Method | Order | Note | |---|---|---| | Administration page | `CONFIG SET slave-read-only no` on the replica, move clients, confirm the old primary is idle, `REPLICAOF NO ONE`, shut down | `slave-read-only` is the older alias of `replica-read-only` | | `CLIENT PAUSE` page | Pause, let the replica catch up, promote, reconfigure clients | Prefer `WRITE` mode since 6.2 | | `FAILOVER` (since 6.2) | Run on the primary: it pauses writes, waits for the replica, demotes itself, sends `PSYNC FAILOVER`, unpauses | Track `master_failover_state`; `TIMEOUT` bounds the wait | `CLIENT PAUSE timeout WRITE` holds write commands while reads continue, keeps the data set still, and stops eviction and expiry. It does not drop anything: when the timeout passes or `CLIENT UNPAUSE` runs, queued commands execute on that server. Choose a timeout longer than your repointing takes, and demote or shut down the old node before it expires. In `WRITE` mode `PUBLISH`, `PFCOUNT` and all scripts also block, and `WAIT` appears blocked because acknowledgments are delayed. `FAILOVER` leaves clients to you unless something else moves them, and the old primary stays up as a replica of the new one. ## Make the promotion durable `REPLICAOF NO ONE` changes the running role, not the file. If the new primary's `redis.conf` has a `replicaof` line, the next restart makes it a replica again. `CONFIG REWRITE` removes that line. Likewise, put `replicaof <new primary> <port>` in the old node's file before starting it on 8.10, so it never comes up as a second primary holding stale data. ## Finish, and the way back Upgrade the old node, start it, and confirm `INFO server` shows the new `redis_version` and the replica link is up. The upgrade pages say nothing about downgrading. Their path back is restoring the files copied before the upgrade, which loses everything written since. A loader refuses a file whose RDB format version is above its own (`Can't handle RDB format version`, and 8.10.3 writes version 15), so plan on the old node being unable to full-sync from the new primary. Take your backup immediately before cutover, and treat the first write on 8.10 as the point where rollback starts to cost data.
- Why not use the FAILOVER command in place of pausing by hand?Often you should. On a 7.2 primary, `FAILOVER TO new-node 6379 TIMEOUT 5000` pauses writes, waits for that replica, demotes itself and hands off, and rolls back at the timeout unless `FORCE` is set. It does not repoint clients, it needs a connected replica, and it is rejected in cluster mode, where `CLUSTER FAILOVER` applies.
- Can you keep the old 7.2 node as your rollback once 8.10 takes writes?Only as a frozen copy. Going back to it loses every write since the switch. You cannot count on it following the new primary either, because a full sync delivers an RDB, and a loader refuses a format version above its own. Redis's upgrade pages document restoring a backup and do not describe a downgrade.
- When would you use the stop, install, start steps on the standalone upgrade page?When a brief outage is acceptable or there is no replica or spare capacity. Those steps stop the server, install Redis 8 and start it, so clients are down meanwhile and a large data set adds load time. The replica procedure exists to remove that outage.
- Upgrade the primary first so the replica can then sync from the newer version.
- REPLICAOF NO ONE is saved in redis.conf automatically.
- CLIENT PAUSE drops the writes that arrive during the pause.
- Since 8.0 has JSON built in, any build loads old module keys without module config.
- A downgrade is safe because the old version can be attached back to the new primary.
- The standalone stop, install, start flow gives you an upgrade with no downtime.
Assumes Redis 7.2 moving to 8.10; the module packaging and licence differences exist because of the 8.0 release, and FAILOVER and CLIENT PAUSE WRITE need 6.2 or later.