Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis DB export/import [closed]

Does anybody know a good solution for export/import in Redis? Generally I need to dump DB (and edit the dump as a case) from a server and load it to another one (e.g. localhost). Maybe some scripts?

like image 703
Sergii Mostovyi Avatar asked Jan 02 '12 19:01

Sergii Mostovyi


People also ask

Is Redis permanent storage?

The only difference from the redis service is that it is configured to store data permanently rather than toss data out when it runs out of memory (as a cache configuration would do). That also means data stored in Redis is replicated when an environment is branched, just like for MySQL, Elasticsearch, or MongoDB.

What is Redis dump RDB?

By default Redis saves snapshots of the dataset on disk, in a binary file called dump. rdb . You can configure Redis to have it save the dataset every N seconds if there are at least M changes in the dataset, or you can manually call the SAVE or BGSAVE commands.

Where is Redis dump RDB?

rdb file in the /var/lib/redis/ directory. You'll want to update the permissions so the file is owned by the redis user and group: sudo chown redis:redis /var/lib/redis/dump.

What is aof persistence?

AOF stands for Append Only File. AOF is actually a persistence technique in which an RDB file is generated once and all the data is appended to it as it comes.


1 Answers

Redis has two binary format files supported: RDB and AOF.

RDB is a dump like what you asked. You can call save to force a rdb. It will be stored in the dbfilename setting you have, or dump.rdb in the current working directory if that setting is missing.

More Info: http://redis.io/topics/persistence

like image 54
seppo0010 Avatar answered Sep 22 '22 03:09

seppo0010