Skip to content

Instantly share code, notes, and snippets.

@tkrynski
Created February 11, 2014 20:11
Show Gist options
  • Save tkrynski/8943112 to your computer and use it in GitHub Desktop.
Save tkrynski/8943112 to your computer and use it in GitHub Desktop.
How to compare two redis dbs

Install Redis RDB Tools from here:

https://github.com/sripathikrishnan/redis-rdb-tools

Take a snapshot of each redis db $ redis-cli save

Copy the snapshots to somewhere else $ cp ~/dump.rdb ./dump-a.rdb

Use rdb tools to dump each db, stripping out bracketed positions, and sorting $ rdb --command diff ./dump-a.rdb | sed s/\\[.*\\]// | sort > ./sorted-a.out

Diff the two files $ diff ./sorted-a.out ./sorted-b.out

Phew!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment