Version 3.8.0

4.2.6. Redis

For restoring the Redis dump use the instructions below.

Detailed information can be found in the official Redis documentation

In general terms, the recovery order will be as follows: uncompress the backup, copy the backup to the Redis working directory, then restart the Redis.

Step-by-step instruction:

1. Stop Redis (because Redis overwrites the current rdb file when it exits).

2. Change the Redis config `appendonly` flag to `no` (otherwise Redis will ignore your rdb file when it starts).

3. Copy your backup rdb file to the Redis working directory (this is the dir option in your Redis config). Also, make sure your backup filename matches the `dbfilename` config option.

  $ gunzip /var/nxs-backup/db/redis/prod/daily/prod_2022-09-05_01-11.rdb.gz
  $ cp /var/nxs-backup/db/redis/prod/daily/prod_2022-09-05_01-11.rdb /var/lib/redis/dump.rdb    
  $ chmod 660 /var/lib/redis/dump.rdb

4. Start Redis.

5. Run `redis-cli BGREWRITEAOF` to create a new appendonly file.

6. Restore the Redis config `appendonly` flag to `yes`