Export-VESQLDatabase
Short Description
Exports backed-up Microsoft SQL databases.
Applies to
Veeam Backup & Replication
Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
Export-VESQLDatabase [-Database] <VESQLDatabase> -Path <string> [-ToPointInTime <datetime>] [-ServerName <string>] [-InstanceName <string>] [-Port <int>] [-UseSQLAuthentication] [-SqlCredentials <pscredential>] [-GuestCredentials <pscredential>] [-ToBackupFile] [-EnableCompression] [-Force] [<CommonParameters>] |
Detailed Description
This cmdlet allows you to export Microsoft SQL databases with the following options:
- Export Microsoft SQL databases to the specified folder.
- Export to the backup file. In this case, the cmdlet will create a new .bak file. Use the ToBackupFile parameter to export to the backup file.
Parameters
Parameter | Description | Type | Required | Position | Accept Pipeline Input | Accept Wildcard Characters |
---|---|---|---|---|---|---|
Database | Specifies a Microsoft SQL database. The cmdlet will export this database. | Accepts the VESQLDatabase object. To get this object, run the Get-VESQLDatabase cmdlet. | True | 0 | True (ByValue) | False |
Path | Specifies the export destination. The cmdlet will export a Microsoft SQL database to the following destinations:
Note: To overwrite the existing file, use the Force parameter. | String | True | Named | False | False |
ToPointInTime | Specifies the point in time within a restore interval of a Microsoft SQL database. The cmdlet will export the database to the state of the specified point in time. | Datetime | False | Named | False | False |
ServerName | Specifies a staging server. Note: This parameter is required if you want to export a Microsoft SQL database with the following options:
| String | False | Named | False | False |
InstanceName | For export to another location. Specifies a name of the Microsoft SQL staging instance. The cmdlet will export a Microsoft SQL database to that instance. | String | False | Named | False | False |
Port | Specifies a port number that will be used to connect to the staging server. | Int32 | False | Named | False | False |
SqlCredentials | Specifies credentials to authenticate against a Microsoft SQL server. If you do not specify Microsoft SQL credentials, the cmdlet will use the current account credentials. | Accepts the PSCredential object. To get this object, run the Get-Credential cmdlet. | False | Named | False | False |
UseSQLAuthentication | Defines that the cmdlet will use the SQL authentication to connect to the staging Microsoft SQL server. | SwitchParameter | False | Named | False | False |
GuestCredentials | Specifies credentials to authenticate to the target server. | Accepts the PSCredential object. To get this object, run the Get-Credential cmdlet. | False | Named | False | False |
ToBackupFile | Defines that the cmdlet will create the backup of a Microsoft SQL database. | SwitchParameter | False | Named | False | False |
EnableCompression | For the ToBackupFile parameter. Defines that the cmdlet will compress the Microsoft SQL database backup. Note: This option is available only if your version of the Microsoft SQL server supports the compression option. | SwitchParameter | False | Named | False | False |
Force | Defines that the cmdlet will overwrite the following 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
Example 1. Exporting to Specific Folder
This example shows how to export a Microsoft SQL database to a specific folder.
Perform the following steps:
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.
|
Example 2. Exporting to Bak. File
This example shows how to export a Microsoft SQL database to the .bak file. The cmdlet will export the database and will create a new .bak file.
Perform the following steps:
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.
|
Example 3. Exporting to Specific Point in Time State
This example shows how to export a Microsoft SQL database to a specific point in time state.
Perform the following steps:
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.
|
Related Commands