Help with data import

As a newbie in both Redis and the forum…

On a redis cluster running v7.2.1 on Kubernetes I have placed the RDB file with the data in /data, and it got imported fine upon restart. To do that I had to disable AOF, so it would read the RDB. With AOF enabled, it was ignoring the RDB file. Now I have to go back to enabling AOF, as we have decided that we prefer AOF persistence to RDB, However when I do that and reinstall, I find that my data has disappeared: when I run a “scan 0” nothing is there. I was expecting that, since the PVC is not affected when I uninstall the Helm chart, the data would persist.

How can get this done? i.e. not lose the data when I switch back to AOF? Can I somehow save the data in AOF format so it will be found upon reinstallation? But is this even possible when I have AOF enabled?

Here is my config after re-enabling AOF

> # User-supplied common configuration:
> # Enable AOF https://redis.io/topics/persistence#append-only-file
> appendonly yes
> # Disable RDB persistence, AOF persistence already enabled.
> save ""
> # End of common configuration

It appears that you’ve encountered data loss when switching from RDB to AOF persistence in your Redis cluster on Kubernetes. This is because Redis handles data persistence differently for RDB and AOF files. When you disable AOF and use RDB, Redis saves snapshots of the data periodically to the RDB file. However, when you enable AOF, it starts writing data changes to the AOF file, which is a log of all write operations.

The reason you lose data is that Redis overwrites the AOF file upon restarting with AOF enabled, and if you didn’t have any data in the AOF file at the time of switching, it effectively starts with an empty dataset.

Thanks & Regards
David Ricks
Appticz