3

Hi I'm trying to import the dump.rdb file to my local redis I'm using ubuntu 14.04,

I've tried this solutions :

  1. backup data from server using SAVE command
  2. Locate the location to put the dump.rdb file

Since I install redis using this tutorial, so I copy the imported dump.rdb to my redis root directory, and then started the redis server like this :

src/redis-server

and then connect the client using :

src/redis-cli

But When I tried to get the all keys using KEYS * I got (empty list or set) where did I go wrong? I've been playing this for hours, any help? thank you

Community
  • 1
  • 1
Gujarat Santana
  • 9,854
  • 17
  • 53
  • 75

2 Answers2

1

If you have followed the steps correctly it will work fine.

    1) Make sure the imported dump.rdb contains your data
    2) Stop the redis server
    3) copy the file in the correct directory (inside redis bin directory) 
parallel to redis-server.
    4) make sure you have the same data, that is copied. (bcz possibilites 
that if your server is still running, it will replace your dump.rdb).
    5) start your redis server you will surely find the values.

If it still doesn't work. Check the dbfilename in your redis.conf file. It must be dbfilename dump.rdb. If there is a change in the location place it in the correct directory.

Hope this works.

Karthikeyan Gopall
  • 5,469
  • 2
  • 19
  • 35
  • I've checked the rdb file in my terminal using `cat` command and I'm sure it contains data, and the second step stop the server I think I already stop it cuz I'm not running the redis-server using service – Gujarat Santana May 29 '16 at 09:39
  • values will be populated from dump.rdb in the service startup only. so make sure your redis server is stopped and then you have carried 3 to 5 steps. Also check for redis.conf file for the location of dump.rdb file. If the issue still persists, you might be doing something wrong. – Karthikeyan Gopall May 29 '16 at 09:50
1

I found the problem in my step, in the documentation quick start redis :
Using src/redis-server Redis was started without any explicit configuration file so I need to start the server with the configuration file to make the server read my dump.rdb file like this :

src/redis-server redis.conf

now I can get all the imported data.

Gujarat Santana
  • 9,854
  • 17
  • 53
  • 75