Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

redis: backing up dump.rdb

Tags:

redis

People also ask

Where does Redis store 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 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.

How do I restore an RDB file?

To restore redis data just move redis backup file (dump. rdb) into your redis directory and start the server. To get your redis directory use CONFIG command can be used. The CONFIG GET command is used to read the configuration parameters of a running Redis server.


From http://redis.io/topics/persistence

Redis is very data backup friendly since you can copy RDB files while the database is running: the RDB is never modified once produced, and while it gets produced it uses a temporary name and is renamed into its final destination atomically using rename(2) only when the new snapshot is complete.

So, the correct way is to simply copy the dump.rdb to your backup location.


If you using Amazon S3, it's very simple to backup Redis database with s3cmd tool.

s3cmd: http://s3tools.org/s3cmd

Tutorial: http://guchex.com/viniciusfbm/post/50/how-to-backup-redis-database-encrypted-to-s3-via-command-line-ubuntu