Skip to main content

Commands: How to start backup or restore operations?

To start or restore backup use StartBackup or StartRestore operations respectively.

StartBackup

Operation StartBackup(
string backupLocation,
DatabaseDocument databaseDocument,
bool incremental,
string databaseName);
Parameters
backupLocationstringPath to directory where backup will be stored.
databaseDocumentDatabaseDocumentDatabase configuration document that will be stored with backup in 'Database.Document' file. Pass null to use the one from <system> database.<br />WARNING: Database configuration document may contain sensitive data which will be decrypted and stored in backup.
incrementalboolIndicates if backup is incremental.
databaseNamestringName of a database that will be backed up.

Example

store
.DatabaseCommands
.GlobalAdmin
.StartBackup(
@"C:\temp\backup\Northwind\",
new DatabaseDocument(),
incremental: false,
databaseName: "Northwind");

StartRestore

Operation StartRestore(DatabaseRestoreRequest restoreRequest);
Parameters
restoreRequestDatabaseRestoreRequestRestore information

Example

store
.DatabaseCommands
.GlobalAdmin
.StartRestore(
new DatabaseRestoreRequest
{
BackupLocation = @"C:\temp\backup\Northwind\",
DatabaseLocation = @"~\Databases\NewNorthwind\",
DatabaseName = "NewNorthwind"
});