RestoreSqlBackupSettings Class

Summary

Settings for restoring database from a backup file
Assembly
Cake.SqlServer.dll
Namespace
Cake.SqlServer
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["RestoreSqlBackupSettings"] class Type type-node

Syntax

public class RestoreSqlBackupSettings

Constructors

Properties

Name Value Summary
BackupSetFile Nullable<int>
If set this specifies which BackupSet should be used when restoring the main backup files.
DifferentialBackupSetFile Nullable<int>
If set this specifies which BackupSet should be used when restoring the differential backup files.
NewDatabaseName string
Gets or sets the new name of the database. Name of the database where to restore. If this is not specified, database name is taken from the backup file
NewStorageFolder DirectoryPath
Gets or sets the new storage folder. Path where data and log files should be stored.If this is not specified, server defaults will be used
SwitchToSingleUserMode bool
Before restoring backup, database will be switched to a single user mode. Default operation is to go into single user mode. However in some situation this might not work. Use this switch to bypass single user mode and restore the DB as it is This property has been obsoleted by SwitchToUserMode which allows for a third option
SwitchToUserMode DbUserMode
Before restoring backup, database will be switched to the user mode selected Default operation is to go into single user mode. However in some situation this might not work. Use this switch to bypass single user mode and restore the DB as it is, or your can use restricted mode instead.
WithReplace bool
Sets the flag to execute restore command `WITH REPLACE` suffix. Allows you to write over an existing database when doing a restore without first backing up the tail of the transaction log. The WITH REPLACE basically tells SQL Server to just throw out any active contents in the transaction log and move forward with the restore.

Extension Methods

Name Value Summary
Dump<RestoreSqlBackupSettings>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<RestoreSqlBackupSettings>(RestoreSqlBackupSettings[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<RestoreSqlBackupSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<RestoreSqlBackupSettings>(string) void
Requires the Cake.Issues addin
ThrowIfNull<RestoreSqlBackupSettings>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<RestoreSqlBackupSettings>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Requires the Cake.Issues addin