Last Updated: May 26, 2018
·
2.139K
· seuros

Backup/Restore Redis databases

In debian platforms Redis store it database in /var/lib/redis/dump.rdb, other platforms might have the same path.

Saving this file is enough for a backup.

Backup steps.

service redis-server stop
cp /var/lib/redis/dump.rdb ~/backups/redis/$(date +%Y%m%d)-redis.rdb
service redis-server start

Restore steps.

service redis-server stop
cp ~/backups/redis/REDIS_BACKUP_FILE.rdb /var/lib/redis/dump.rdb 
service redis-server start