Export-VESQLPublishedDatabase
Short Description
Exports a published Microsoft SQL Server database.
Applies to
Veeam Backup & Replication
Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
Export-VESQLPublishedDatabase [-Database] <VESQLPublishedDatabase> [-Path] <String> [-EnableCompression <SwitchParameter>] [-Force <SwitchParameter>][<CommonParameters>] |
Detailed Description
This cmdlet exports a published Microsoft SQL Server database to the specified destination on the machine where the Veeam Backup & Replication console is installed.
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 VESQLPublishedDatabase object. To get this object, run the Get-VESQLPublishedDatabase cmdlet. | True | 0 | True (ByValue) |
Path | Specifies a full file path. The cmdlet will the export published Microsoft SQL Server database to that file path. | String | True | 1 | False |
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. | SwitchParameter | 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. | SwitchParameter | False | Named | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.
Example
Exporting Published Microsoft SQL Database
This example shows how to export a published Microsoft SQL database.
$session = Get-VESQLRestoreSession $database = Get-VESQLPublishedDatabase -Session $session[0] -Name "SQLDatabase" Export-VESQLPublishedDatabase -Database $database -Path "C:\NewPath\File.bak" |
Perform the following steps:
- Run the Get-VESQLRestoreSession cmdlet. Save the result to the $session variable.
The cmdlet will return an array of restore sessions. Note the ordinal number of the necessary restore session. In our example, it is the first restore session in the array.
- Run the Get-VESQLPublishedDatabase cmdlet. Set the $session variable as the Session parameter value. Specify the Name parameter value. Save the result to the $database variable.
- Run the Export-VESQLPublishedDatabase cmdlet. Set the $database variable as the Database parameter value. Specify the Path parameter value.
Related Commands