4

We have two Azure Redis instances on Azure. The source is on "standard" setting in Azure. We need to copy all 35GB from a standard build to a premium build (not migrate).

What is the best method? The data should be static. You cannot export the data in standard, you cannot shard either. We have maxed out the size, and need to move to one that supports sharding.

4
  • Do you have access to dump.rdb file? Commented May 28, 2018 at 14:38
  • We do not have access to that file. Commented May 30, 2018 at 23:11
  • I've updated my answer, check it out Commented Jun 4, 2018 at 9:50
  • Could you scale the cache to premium? You would gain access to export then. Depending on your app's architecture, you could also avoid export/import by scaling the first cache and not having to change your app at all. Commented Sep 7, 2018 at 22:20

1 Answer 1

6

1. Editing config file

In target Redis's config file set

slaveof sourceIP sourcePort slave-read-only no 

It will efficiently replicate source db into your new one by transmitting RDB file. Then you can comment out these lines and shut down source instance. Note, that old keys in target instance are not preserved and not rewritten.

2. CONFIG SET command

Will not help you on this, sad story.

127.0.0.1:6371> CONFIG SET slaveof "localhost 6370"
(error) ERR Unsupported CONFIG parameter: slaveof

3. MIGRATE command

MIGRATE remotehost remoteport "" 0 5000 COPY KEYS * 

Will not work either. But there is a workaround: https://stackoverflow.com/a/42686861/78569

redis-cli --raw KEYS '*' | xargs redis-cli MIGRATE my.redis 6379 "" 0 5000 KEYS

(please upvote that guy, if you used it)

4. Shell scripting

Here's a script that pipes KEYS output into MIGRATE and adds some other features: https://gist.github.com/nicStuff/ee7feb8eed00174a46db42812545b403

5. RDB download

You can download RDB dump with Redis protocol even if you don't have access to the file on server:

redis-cli -h <host> -p <port> --rdb /path/to/local/copy/dump.rdb 
Sign up to request clarification or add additional context in comments.

1 Comment

will try out 5th option. i have linux redis running on some server who's data i needed to copy to my redis which is running on windows 10. let's see the result

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.