Search code examples
redisstartup

Redis is empty after startup, altough there is an .rdb file


After I ran "shutdown save" in my redis-cli, waited for the "save" command to finish (followed the redis log) and backed up my redis .rdb file, I tried starting the redis server from the begining and it was started with an empty DB (dbsize =0!!!).

What can I do ? How can I restore my redis from the .rdb file?


Solution

  • The problem was indeed in my configuration file. I saved my .rdb file called tal.rdb as old-tal.rdb so it won't be effected. Then, I've started my Redis server again, saw it has 0 keys, inserted 10000 keys and ran the save"command and, as a result, I saw it has created a file dump.rdb (the default dbfilename for Redis .rdb files) in the correct directory path, although in the configuration file the dbfilename was tal.rdb, so I understand my configuration file was bad. To fix this, I replaced the configuration file with a backed up file and restarted my Redis with a copy of tal.rdb and then it was started correctly (10M keys). Thanks everyone!