Upgrading Redis with zero downtime

Let Suppose a Scenario where we have a Redis Server (Version: redis-4.0.9) running on a Server with Redis Port 6388 and we want to upgrade this to latest Version( 5.0.8) without any downtime.Current location of existing installed Redis is /usr/local/bin/redis-server

We will follow the following steps upgrading Redis Server without downtime.

1) Install a latest version(5.0.8) of Redis from source on the Same Server with a different installation location(/opt/local) without doing any changes on existing Redis Server .

2) Configure a different Redis Port 6399 on the newly Installed latest-Version Redis Server.

3) Make the existing old version- 4.0.9 Redis-Server as Master and newly installed Latest-Version-5.0.8 Redis Server as slave.

4)Verify the Master-Slave setup

5) Promote the SLAVE as Master.

6) Verify the new Master Server

7) Change the Redis Port on your Application.

Let us perform the above steps in details: