This is an archive version of the document. To get the most up-to-date information, see the current version.

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:

  • The folder - use this option to export the database to the specified folder.
  • The .bak file - use this option to export the database to the backup file. Specify the ToBackupFile parameter to export to the backup file.

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:

  • Export with the ToPointInTime option.
  • Export to the .bak file.

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:

  • The .bak file that you specify in the Path parameter.
  • Microsoft SQL database files in case they are located in the target folder.

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

Export-VESQLDatabaseExample 1. Exporting to Specific Folder

Export-VESQLDatabaseExample 2. Exporting to Bak. File

Export-VESQLDatabaseExample 3. Exporting to Specific Point in Time State

Related Commands