0

I dump all data to a text file using redis-dump > output.txt command. Output file contains SET commands which consists of multiple lines.

SET     3ds:request:021333976bab4102a6d119293a1d0717 '{
  "offer" : {
    "id" : 0,
    "secureId" : "796a623e-77f1-427b-86ac-6d1d0fede212"
  },
}'

I import output.txt into another redis server using cat output.txt | redis-cli command. I get following error messages:

(error) ERR unknown command 'offer'

I guess this is happening because of the newline characters inside the data.

How can I delete these newline characters? Or is there a better approach to resolve this problem?

Halil
  • 1,795
  • 1
  • 24
  • 39
  • Do you suggest to just copy the data file? – Halil Sep 17 '19 at 15:33
  • Do you have an objection to that? You're fundamentally doing a backup and restore here, and Redis recommends the RDB files for backing up. https://redis.io/topics/persistence – ceejayoz Sep 17 '19 at 15:43

0 Answers0