title: How to use redis' `DUMP` and `RESTORE` (offline)?
body: <p>I tried redis's <a href="http://redis.io/commands/dump" rel="noreferrer">DUMP</a> command, redirect to file (or pipe), but <a href="http://redis.io/commands/restore" rel="noreferrer">RESTORE</a> report this error:</p>
  
  <pre><code>$ redis-cli dump test &gt; /tmp/test.dump
  $ cat /tmp/test.dump | redis-cli -x restore test1 0
  (error) ERR DUMP payload version or checksum are wrong
  $ redis-cli dump test | redis-cli -x restore test1 0
  (error) ERR DUMP payload version or checksum are wrong
  </code></pre>
  
  <p>I am aware that <a href="http://redis.io/commands/migrate" rel="noreferrer">MIGRATE</a> can do this online, but <a href="http://redis.io/commands/migrate" rel="noreferrer">MIGRATE</a> also delete that key from original server, and I don't want my redis expose to public internet.</p>
  
  <p>There are some third-party options, <a href="https://github.com/sripathikrishnan/redis-rdb-tools" rel="noreferrer">redis-rdb-tools</a> for example, but after all, how exactly do <code>DUMP</code> and <code>RESTORE</code> work?</p>