Upgrade a standalone Redis instance to Redis 8
Upgrade a standalone instance of Redis Open Source or Redis Stack to Redis 8
Redis Open Source |
---|
The supported upgrade paths are:
- Redis Open Source 7.x (with or without modules) to Redis 8 in Redis Open Source
- Redis Stack 7.2 or 7.4 to Redis 8 in Redis Open Source
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.
Save your current data
Before upgrading, create a snapshot of your current dataset using the following command:
redis-cli SAVE
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.
Use the following command to identify where your data directory is located:
redis-cli CONFIG GET dir
Make a copy of these files before proceeding:
cp -r /path/to/redis-data-dir/ /path/to/backup/
Upgrade Redis
Follow these steps to upgrade Redis.
- Stop the current version of Redis Open Source or Redis Stack server.
- Follow the installation steps that correspond to your Redis distribution to install Redis 8.
- Start Redis 8 if it didn't start automatically.
Restore from saved files (if necessary)
If Redis fails to start properly or if data is missing after the upgrade, restore from your backup.
- Stop the Redis server.
- Copy the backup file back into the the Redis data directory:
cp -r /path/to/backup/ /path/to/redis-data-dir/
- Start Redis again and verify data is restored:
redis-cli INFO persistence
Verify the upgrade
Use the following command to confirm you're running Redis 8:
redis-cli INFO server | grep redis_version
You should also verify that your data is accessible and that your clients can connect successfully.