Export-VESQLPublishedDatabase
Short Description
Exports a published Microsoft SQL Server database.
Note |
|
In Veeam Backup & Replication 13.1, this cmdlet became deprecated. Use the |
Product: Veeam Backup & Replication
Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
|
Export-VESQLPublishedDatabase [-Database] <VESQLPublishedDatabase> [-Path] <String> [-EnableCompression] [-Force] [<CommonParameters>] |
Detailed Description
This cmdlet exports a published Microsoft SQL Server database to the specified destination on the machine where the PowerShell session is running.
Note |
|
The published database can only be exported as a .bak file. |
Parameters
|
Parameter |
Description |
Type |
Required |
Position |
Accept Pipeline Input |
|---|---|---|---|---|---|
|
Database |
Specifies a published Microsoft SQL Server database that you want to export.
Accepts the |
True |
0 |
True (ByValue) |
|
|
EnableCompression |
Defines that the cmdlet will compress the backup file. Note: This option is available only if your version of Microsoft SQL Server supports the compression option. |
|
False |
Named |
False |
|
Force |
Defines that if there is a .bak file with the same name on the target location, the cmdlet will overwrite it. Note: The cmdlet will show no prompt before executing the command. |
|
False |
Named |
False |
|
Path |
Specifies a full file path. The cmdlet will the export published Microsoft SQL Server database to that file path. |
|
True |
1 |
False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Docs.
Examples
Exporting Published Microsoft SQL Server Database
This example shows how to export a published Microsoft SQL Server database.
|
$session = Get-VESQLRestoreSession $database = Get-VESQLPublishedDatabase -Session $session[0] -Name "New SQL Database" Export-VESQLPublishedDatabase -Database $database -Path "C:\NewPath\File.bak" |
Perform the following steps:
- Run the
Get-VESQLRestoreSessionReturns active restore sessions started to perform operations with backed-up Microsoft SQL Server databases. cmdlet. Save the result to the$sessionvariable.The cmdlet will return an array of restore sessions. Note the ordinal number of the necessary restore session. In this example, it is the first restore session in the array.
- Run the
Get-VESQLPublishedDatabaseReturns published Microsoft SQL Server databases. cmdlet. Set the$sessionvariable as theSessionparameter value. Specify theNameparameter value. Save the result to the$databasevariable. - Run the
Export-VESQLPublishedDatabasecmdlet. Set the$databasevariable as theDatabaseparameter value. Specify thePathparameter value.
Related Commands
Get-VESQLRestoreSessionReturns active restore sessions started to perform operations with backed-up Microsoft SQL Server databases.Get-VESQLPublishedDatabaseReturns published Microsoft SQL Server databases.