Skip to content

Commit 679320f

Browse files
authored
DEV: add upgrade instructions for Redis 8 (#1424)
* Initial commit of upgrade docs * 2nd commit of upgrade docs
1 parent 17d7a77 commit 679320f

File tree

7 files changed

+167
-12
lines changed

7 files changed

+167
-12
lines changed

content/operate/oss_and_stack/install/_index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ categories:
66
- oss
77
description: How to install Redis CE on your target platform
88
hideListLinks: true
9-
linkTitle: Install
9+
linkTitle: Install and upgrade
1010
title: Install Redis Community Edition (CE)
1111
weight: 30
1212
---
1313

14-
You can install [Redis CE]({{< relref "/operate/oss_and_stack/" >}}) locally on your machine. Redis CE is available on Docker, Linux, macOS, and Windows (using Docker only).
14+
You can install [Redis CE]({{< relref "/operate/oss_and_stack/" >}}) locally on your machine or in the cloud.
15+
Redis CE is available on Docker, Linux, macOS, and Windows (using Docker only).
1516

16-
Here are the installation instructions:
17+
Here are the installation and upgrade instructions:
1718

1819
* [Install Redis CE]({{< relref "/operate/oss_and_stack/install/install-stack" >}})
20+
* [Upgrade Redis CE]({{< relref "/operate/oss_and_stack/install/upgrade" >}})
1921

2022
While you can install Redis CE locally, you might also consider using Redis Cloud by creating a [free account](https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users). Redis CE 8.0 is not yet available on Redis Cloud.

content/operate/oss_and_stack/install/archive/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ hideListLinks: true
99
linkTitle: Archived instructions
1010
title: Install Redis Community Edition or Redis Stack
1111
weight: 30
12-
bannerText: These docs apply to versions of Redis Community Edition and Redis Stack earlier than 8.0.0.
12+
bannerText: These docs apply to Redis Community Edition and Redis Stack version 7.x.
1313
bannerChildren: true
1414
---
1515

content/operate/oss_and_stack/install/build-stack/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ categories:
55
- stack
66
- oss
77
description: Build and run Redis Community Edition 8 on Linux and macOS
8-
linkTitle: Build and run Redis Community Edition 8
8+
linkTitle: Build and run Redis CE
99
stack: true
10-
title: Build and run Redis Community Edition 8
10+
title: Build and run Redis CE
1111
weight: 20
1212
---
1313

content/operate/oss_and_stack/install/install-stack/windows.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,3 @@ weight: 7
1313
## Run Redis Community Edition (CE) on Windows using Docker
1414

1515
To install Redis CE on Windows, you will need to have Docker installed. When Docker is up and running, open Windows PowerShell and follow the instructions described in [Run Redis CE on Docker]({{< relref "/operate/oss_and_stack/install/install-stack/docker" >}}). Then, use Docker to connect with `redis-cli` as explained in that topic.
16-
17-
{{% alert title="About using WSL and Ubuntu for Windows " color="warning" %}}
18-
If you attempt to use Windows Subsystem for Linux (WSL) or Ubuntu for Windows to follow [Linux instructions]({{< relref "/operate/oss_and_stack/install/install-stack/apt" >}}), you will get a `systemd` error telling you `System has not been booted with systemd as init system (PID 1). Can't operate.` Do not fret. Just use Docker.
19-
20-
_`systemd` is a suite of basic building blocks for a Linux system._ For more information about its function, see [System and Service Manager](https://systemd.io/). This becomes an issue due to the lack of support for Linux workflows on WSL. But, you can test the instructions listed in [Systemd support is now available in WSL!](https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/). Let us know how that worked for you.
21-
{{% /alert %}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
description: Upgrade Redis Community Edition
8+
linkTitle: Upgrade Redis CE
9+
stack: true
10+
title: Upgrade Redis Community Edition
11+
weight: 10
12+
---
13+
14+
Upgrade Redis Community Edition to version 8 from version 7.x with or without modules or from Redis Stack 7.2 and 7.4.
15+
16+
<hr/>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
description: Upgrade a Redis Community Edition cluster to Redis 8
8+
linkTitle: Redis cluster
9+
title: Upgrade a Redis cluster to Redis 8
10+
weight: 30
11+
---
12+
13+
{{< note >}}
14+
The supported upgrade paths are:
15+
- Redis Community Edition 7.x (with or without modules) to Redis Community Edition 8
16+
- Redis Stack 7.2 or 7.4 to Redis Community Edition 8
17+
{{< /note >}}
18+
19+
{{< note >}}
20+
It's essential to practice upgrading Redis in a controlled environment before upgrading it in a production environment.
21+
Docker is an excellent tool to use for this purpose.
22+
{{< /note >}}
23+
24+
Follow these instructions to upgrade a Redis cluster. This guide assumes you have installed Redis using one of the supported methods listed [here]({{< relref "/operate/oss_and_stack/install/archive" >}}).
25+
26+
### Save your current data
27+
28+
Before upgrading, create a snapshot of your current dataset on each node (identified by its port) using the following command:
29+
30+
```bash
31+
redis-cli -p <port> SAVE
32+
```
33+
34+
Repeat for every node in your cluster, both masters and replicas.
35+
36+
This creates or updates an `RDB` file, for example `dump.rdb`, in the node's Redis data directory. If you use AOF persistence, the files will be named `appendonly.aof.*` and they will be written in the `appendonlydir` directory inside the data directory. The AOF-related directory and file names are the defaults. Use the names defined in your `redis.conf` file if different from the defaults.
37+
38+
Use the following command on each node to identify where your data directories are located:
39+
40+
```bash
41+
redis-cli -p <port> CONFIG GET dir
42+
```
43+
44+
Make a copy of the files contained in each of those directories before proceeding.
45+
46+
### Upgrade Redis nodes
47+
48+
Upgrade each node one at a time, starting with the replicas, using these steps:
49+
50+
1. Stop the current version of Redis CE or Redis Stack server.
51+
1. Follow the installation steps that correspond to your [Redis distribution]({{< relref "/operate/oss_and_stack/install/install-stack" >}}) to install Redis 8.
52+
1. Start Redis 8 if it didn't start automatically.
53+
54+
### Restore from saved files (if necessary)
55+
56+
If necessary, restore the saved files to their original locations on each node. Then restart Redis on each node.
57+
58+
### Verify the upgrade
59+
60+
```bash
61+
redis-cli -p <port> INFO server | grep redis_version
62+
redis-cli -p <port> cluster info
63+
redis-cli --cluster check <IP address>:<port>
64+
```
65+
66+
You should also verify that your data is accessible and that your clients can connect successfully.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
description: Upgrade a standalone instance of Redis Community Edition or Redis Stack to Redis 8
8+
linkTitle: Standalone (single node)
9+
title: Upgrade a standalone Redis instance to Redis 8
10+
weight: 20
11+
---
12+
{{< note >}}
13+
The supported upgrade paths are:
14+
- Redis Community Edition 7.x (with or without modules) to Redis Community Edition 8
15+
- Redis Stack 7.2 or 7.4 to Redis Community Edition 8
16+
{{< /note >}}
17+
18+
{{< note >}}
19+
It's essential to practice upgrading Redis in a controlled environment before upgrading it in a production environment.
20+
Docker is an excellent tool to use for this purpose.
21+
{{< /note >}}
22+
23+
Follow these instructions to upgrade a single-node Redis server. This guide assumes you have installed Redis using one of the supported methods listed [here]({{< relref "/operate/oss_and_stack/install/archive" >}}).
24+
25+
### Save your current data
26+
27+
Before upgrading, create a snapshot of your current dataset using the following command:
28+
29+
```bash
30+
redis-cli SAVE
31+
```
32+
33+
This creates or updates an `RDB` file, for example `dump.rdb`, in your Redis data directory. If you use AOF persistence, the files will be named `appendonly.aof.*` and they will be written in the `appendonlydir` directory inside the data directory. The AOF-related directory and file names are the defaults. Use the names defined in your `redis.conf` file if different from the defaults.
34+
35+
Use the following command to identify where your data directory is located:
36+
37+
```bash
38+
redis-cli CONFIG GET dir
39+
```
40+
41+
Make a copy of these files before proceeding:
42+
43+
```bash
44+
cp -r /path/to/redis-data-dir/ /path/to/backup/
45+
```
46+
47+
### Upgrade Redis
48+
49+
Follow these steps to upgrade Redis.
50+
51+
1. Stop the current version of Redis CE or Redis Stack server.
52+
1. Follow the installation steps that correspond to your [Redis distribution]({{< relref "/operate/oss_and_stack/install/install-stack" >}}) to install Redis 8.
53+
1. Start Redis 8 if it didn't start automatically.
54+
55+
### Restore from saved files (if necessary)
56+
57+
If Redis fails to start properly or if data is missing after the upgrade, restore from your backup.
58+
59+
1. Stop the Redis server.
60+
2. Copy the backup file back into the the Redis data directory:
61+
```bash
62+
cp -r /path/to/backup/ /path/to/redis-data-dir/
63+
```
64+
3. Start Redis again and verify data is restored:
65+
```bash
66+
redis-cli INFO persistence
67+
```
68+
69+
### Verify the upgrade
70+
71+
Use the following command to confirm you're running Redis 8:
72+
73+
```bash
74+
redis-cli INFO server | grep redis_version
75+
```
76+
77+
You should also verify that your data is accessible and that your clients can connect successfully.

0 commit comments

Comments
 (0)