Operations: Server: How to Restore a Database from the Backup

To restore a database from its backup, use RestoreBackupOperation.


This article describes restoring a database using a C# client. You can also restore a database using RavenDB Studio.


public RestoreBackupOperation(RestoreBackupConfiguration restoreConfiguration)

public class RestoreBackupConfiguration
    public string DatabaseName { get; set; }

    public string BackupLocation { get; set; }

    public string LastFileNameToRestore { get; set; }

    public string DataDirectory { get; set; }

    public string EncryptionKey { get; set; }
DatabaseName string Database name to create during the restore operation
BackupLocation string Directory containing backup files
LastFileNameToRestore string Used for partial restore
DataDirectory string Optional: Database data directory
EncryptionKey string Encryption key used for restore


RestoreBackupConfiguration config = new RestoreBackupConfiguration()
    BackupLocation = @"C:\backups\Northwind",
    DatabaseName = "Northwind"
RestoreBackupOperation restoreOperation = new RestoreBackupOperation(config);