How do you restore a Redis instance from a previously saved RDB backup file?
Short answer
You stop the Redis server, replace its current data file with the backup RDB file you want to restore, ensuring it is placed in the directory and with the filename Redis expects based on its configuration, and then start the Redis server again, which will automatically load the…
Advertisement
AModel answer
You stop the Redis server, replace its current data file with the backup RDB file you want to restore, ensuring it is placed in the directory and with the filename Redis expects based on its configuration, and then start the Redis server again, which will automatically load the data from that restored file.
Example
systemctl stop redis cp /backups/redis_backup_20260907.rdb /var/lib/redis/dump.rdb systemctl start redis
Real-world example
A company recovers their Redis instance after a hardware failure by stopping the service, replacing the data file with their most recent backup, and restarting Redis, quickly restoring their application's cached data.
Likely follow-ups
- What happens if the restored RDB file is from a significantly older backup than expected?
- Do you need to restore both RDB and AOF files, or just one?
Related topics