<p>I have this redis instance in a pod running on 1.21 cluster.</p>
<p>Running <code>kubectl cp -c redis --request-timeout=1m redis-pod:data/dump.rdb /tmp/data/dump.rdb</code></p>
<p>or</p>
<p><code>kubectl exec --request-timeout=1m -i redis-pod -- cat /data/dump.rdb &gt; /tmp/data/dump.rdb</code></p>
<p>I get the following two errors:</p>
<p>The <code>kubectl cp</code> approach generates: <code>error: unexpected EOF</code></p>
<p>The second approach creates the file but incomplete, with a smaller size and when loading it with another redis instance I got a server message like the DB is corrupted and wont start.</p>
<p>I've ran redis <code>SAVE</code> command before. Also copied the <code>dump.rdb</code> to another directory a tried to copy that one.</p>
<p>Any help would be appreciated.</p>

RicHincapie
<p>You can use the <strong>kubectl  cp</strong> <strong>--retries=10</strong> if the connection is getting timeout while copying the file.</p>
<p>If you are in <strong>Redis POD</strong> and just want to <strong>take out</strong> the <strong>data</strong> you can install the <strong>aws</strong>, <strong>gcp</strong> <strong>CLI</strong> and upload the whole file from POD to the bucket.</p>
<p>Touching Redis data files is fine, i to have played lot but would recommend checking out the <a href="https://github.com/redis-developer/riot" rel="nofollow noreferrer"><strong>Riot-Redis</strong></a></p>
<p>Used it a lot in migrating large production system Redis data from one to another cluster.</p>
<p>Read more about Riot-Redis doc : <a href="https://developer.redis.com/riot/riot-redis/" rel="nofollow noreferrer">https://developer.redis.com/riot/riot-redis/</a></p>
<p><strong>RIOT-Redis</strong> is a <strong>data</strong> <strong>migration</strong> tool for <strong>Redis</strong>.</p>
<blockquote>
<p>Most Redis migration tools available today are offline in nature.
Migrating data from AWS ElastiCache to Redis Enterprise Cloud for
example means backing up your Elasticache data to an AWS S3 bucket and
importing it into Redis Enterprise Cloud using its UI. RIOT-Redis
allows for live data migration between any Redis databases.</p>
</blockquote>
