You are using Redis with RDB persistence enabled for legacy reasons, a specific use case or simply because that’s the default persistence method (even in Redis 6) and you would like to switch to AOF persistence by default.
As a Redis user, you will most probably encounter this situation a day. You are wondering what is the best approach to migrate from one persistence format to another or to use both?
Unfortunately, Redis requires to restart your server to enable AOF persistence. Here is a 4 steps process:
- Create a copy of your existing RDB backup file.
- From a Redis client trigger the command
bgrewriteaof. This will create a backup file (named by default
appendonly.aof) using the AOF format.
- Edit your
redis.confto enable AOF persistance with the
appendonly yesconfiguration line.
- Restart your Redis server.