Copy redis database (.rdb file) from a remote server to local
Asked Answered
M

0

10

I was given a Redis server that is set up remotely. I can access data in that and I can do CRUD operation with that server. But I want the replica of the same database in my local.

I have Redis desktop manager setup in my local. And also redis-server setup running.

Things I have tried:

  1. using SAVE command.

    I have connected to the remote server and executed save command. It ran successfully and created dump.rdb file on that server. But I can't access that file as I don't have permission for server FTP.

  2. using BGSAVE

    same scenario here also

  3. using redis-cli command

    redis-cli -h server ip -p 6379 save > \\local ip\dump.rdb
    

    Here I got an error The network name cannot be found.

Can anyone please suggest me on how can I copy the .rdb file from the server to local?

Myers answered 20/6, 2017 at 6:36 Comment(6)
So do you have an SSH access to the remote machine? You can mostly transfer files using it, too. en.wikipedia.org/wiki/SSH_File_Transfer_ProtocolTheologue
I don't think so. Tried with putty and pscp commands to get access via SSH. No luck. Any other commands to access remote server?Myers
No, As I said earlier I use Redis desktop manger to connect. A snippet of configuration is uploaded here : imgur.com/a/F56Oq Apart from that I have redis-server installed in my machine which I use to run redis-cli commands.Myers
if you can connect with redis-cli, you can use redis-cli -h server --rdb dump.rdb to have it save locally.Punctual
@ItamarHaber redis-cli -h server --rdb dump.rdb worked actually. It has saved db in local. But when i restarted db it is throwing this error : imgur.com/a/MHbS4 Any idea what is this about?Myers
I'm guessing that the server you're running is of an older version than the one that the dump is fromPunctual

© 2022 - 2024 — McMap. All rights reserved.