In order to back up, we will use the following command to the core that we would like to take a backup of:
http://localhost:8983/solr/myschema/replication?command=backup&name=mybackup
Here, myschema is the name of the core that we are working with and /replication is the handler to the backup. In the end, you can see we've specified command=backup to back up our core.
The backup command will bring data from the last committed index. At any point in time, there can be only one backup call being made. Otherwise, we will get an exception if there is a backup process already going on.
A backup request can have the following parameters:
Parameter name |
Description |
location |
The location for the backup. Unless you specify an absolute path, everything will be relative to Solr's instance directory. The snapshot will be created in a directory named snapshot.<name>. If you don't specify the name, then the directory name will have a timestamp as the suffix, such as snapshot.<yyyyMMddHHmmssSSS>. |
numberToKeep |
Defines the number of backups. You cannot use this parameter if you have already defined maxNumberOfBackups in solrconfig.xml. |
repository |
Defines the name of the repository to be used for the backup. The default will be the filesystem repository. |
commitName |
Defines the name of the commit that was used while taking a snapshot with the CREATESNAPSHOT command. |