Redis - Backup

Redis SAVE command is used to create a backup of the current Redis database.


Following is the basic syntax of redis SAVE command.> SAVE 


Following example creates a backup of the current database.> SAVE  

This command will create a dump.rdb file in your Redis directory.

Restore Redis Data

To restore Redis data, move Redis backup file (dump.rdb) into your Redis directory and start the server. To get your Redis directory, use CONFIG command of Redis as shown below.> CONFIG get dir  
1) "dir" 
2) "/user/tutorialspoint/redis-2.8.13/src" 

In the output of the above command /user/tutorialspoint/redis-2.8.13/src is the directory, where Redis server is installed.


To create Redis backup, an alternate command BGSAVE is also available. This command will start the backup process and run this in the background.

Example> BGSAVE  
Background saving started