RSS
 

Redis: Converting from RDB to AOF

27 May

This is just a quick note about a question we had that we couldn’t find an easy answer to.

We decided to switch from redis’s default behavior of background saving (bgsave) a .rdb file to using append-only-file (AOF) mode. We thought we could just change the conf and restart, however, it created an empty AOF and was missing all the data from our .rdb.

Apparently the correct way to transition between the two is:
-While running in normal bgsave mode, run:
redis-cli BGREWRITEAOF

When that finishes, shut down the server, change the conf and start it back up. Now all your data should be present, and it should be using the AOF exclusively.

 
 

Leave a Reply

 
 
  1. James Hartig

    May 27, 2010 at 6:51 pm

    I think I remember mentioning this ;) lol

     
  2. Jay

    May 28, 2010 at 2:22 pm

    Too bad my memory sucks. :P