You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 5.0 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Backup and restore

Use POST methods to start or restore backup.

Non blocking operations

Execution of the backup or restore request simply starts the operation on the server and returns immediately. The request does not wait for the operation to complete.

Start backup

Syntax

curl \
	http://{serverUrl}/fs/{fileSystemName}/admin/backup?incremental={incremental}  \
	-X POST \
	--d "{backupRequest}"

Request

Payload
JSON formatted FilesystemBackupRequest

Backup and sensitive data

The file system configuration document may contain sensitive data which will be decrypted and stored in the backup.

Query parameter Required Description
fileSystemName Yes The name of the file system to backup
incremental No Indicates if it should be the incremental backup

Response

Status code Description
201 Created
Return Value Description
None The request does not return any message

Example

curl \
    -X POST http://localhost:8080/fs/NorthwindFS/admin/backup?incremental=false \
    -d "{'BackupLocation':'c:\\temp\\backup\\NorthwindFS'}"

< HTTP/1.1 201 Created
If you are interested in checking the current backup status you can retrieve it by getting Raven/Backup/Status configuration item.

Start restore

Syntax

curl \
	http://{serverUrl}/admin/fs/restore  \
	-X POST \
	-d "{restoreRequest}"

Request

Payload
JSON formatted FilesystemRestoreRequest

Response

Status code Description
200 OK
Return Value Description
OperationId The operation identifier

Example

curl \
	http://localhost:8080/admin/fs/restore  \
	-X POST \
	-d "{'FilesystemName':'NewNorthwindFS','BackupLocation':'c:\\temp\\backup\\NorthwindFS','IndexesLocation':null,'RestoreStartTimeout':null,'FilesystemLocation':'~\\FileSystem\\NewNorthwindFS','Defrag':false,'JournalsLocation':null}"
< HTTP/1.1 200 OK

{"OperationId":1}