sripathikrishnan / redis-rdb-tools

Parse Redis dump.rdb files, Analyze Memory, and Export Data to JSON
https://rdbtools.com
MIT License
5.07k stars 739 forks source link

potential issues with escaping with rdb-tools? #156

Closed gingerlime closed 5 years ago

gingerlime commented 5 years ago

We're using rdb-tools to convert a redis rdb dump to restore it onto a different system (where there's no way to import the rdb file directly).

We essentially run:

rdb_tools --c protocol --escape utf8 -f /var/backups/redis/dump.txt /var/backups/redis/dump.rdb

and then take the dump.txt and pipe it into the other redis:

cat /var/backups/redis/dump.txt | redis-cli -h redis_host -p 6379 -a $REDIS_PASSWORD --pipe

This seems to work fine, but then we spotted some intermittent issues with some of the data. The data is marshalled in ruby, and in some cases Marshal.load failed to load with an error, e.g.: ArgumentError: dump format error(0x37)

How can we resolve/avoid this? Is the problem related to using --escape utf8?

gingerlime commented 5 years ago

Looks like a RTFM-issue. Should have used --escape raw.