How do I load the dump.rdb file into redis?
37,039
Solution 1
Edit your config file to set the dir
option to the current working directory:
# The filename where to dump the DB
dbfilename dump.rdb
# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# Also the Append Only File will be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir /current/working/directory
Solution 2
Do as follow:
- modify the redis.conf, disable the appendonly.aof
appendonly no
Restart the redis-server
Run
redis-cli BGREWRITEAOF
, to create a new appendonly file.Modify redis config
appendonly
toyes
and restart your redis-server
Please see this
Solution 3
We found we had to switch aof off beforehand otherwise redis creates a blank aof at boot and uses that instead of the rdb file. Once redis creates a populated aof then you can switch aof back on.
Related videos on Youtube
Author by
Alex
Updated on September 18, 2022Comments
-
Alex over 1 year
I have a dump.rdb file, which is in the same directory as redis.config.
When I start my sever:
redis-server ./redis.config
It does not load the data in that 1 GB file.
How do I load that data?
-
TheStoryCoder over 3 yearsIt's important to also turn off Append Only mode:
appendonly no
- otherwise nothing happens. (as per other answers here) -
TheStoryCoder over 3 yearsSee also duplicate: stackoverflow.com/questions/14497234/…