Export-VESQLPublishedDatabase
Short Description
Exports published Microsoft SQL databases.
Applies to Veeam Backup & Replication
Product Edition: Community, Standard, Enterprise, Enterprise Plus
Syntax
Export-VESQLPublishedDatabase [-Database] <VESQLPublishedDatabase> [-Path] <string> [-EnableCompression] [-Force][<CommonParameters>] |
Detailed Description
This cmdlet exports published Microsoft SQL databases to the specified destination.
|
The databases are exported to .bak files only. |
Parameters
Parameter | Description | Type | Required | Position | Accept Pipeline Input | Accept Wildcard Characters |
---|---|---|---|---|---|---|
Database | Specifies a published Microsoft SQL database that you want to export. | Accepts the VESQLPublishedDatabase object. To get this object, run the Get-VESQLPublishedDatabase cmdlet. | True | 0 | True (ByValue) | False |
Path | Specifies a full file path. The cmdlet will export published a Microsoft SQL database to that file path. | String | True | 1 | False | False |
EnableCompression | For the ToBackupFile parameter. Indicates that the cmdlet will compress the backup file. Note: This option is available only if your version of the Microsoft SQL server supports the compression option. | SwitchParameter | False | Named | False | False |
Force | Indicates that the cmdlet will overwrite the existing Microsoft SQL database files. Note: The cmdlet will show no prompt before executing the command. | SwitchParameter | False | Named | False | 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 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 Get-VESQLRestoreSession cmdlet will return an array of restore sessions. Mind 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 as the Database parameter value. Specify the Path parameter value.
Related Commands