Export-DlmDatabaseRelease
Published 10 March 2016
Export-DlmDatabaseRelease
Exports a Release Artifact, which are produced by the New-DlmDatabaseRelease cmdlet to a folder or .zip file on disk.
Syntax
Export-DlmDatabaseRelease [-InputObject] <IReleaseArtifact> -Path <Object> [-Format <OutputFormat>] [-Force] [<CommonParameters>]
|
Description
The Export-DlmDatabaseRelease cmdlet exports database deployment resources, which are produced by the New-DlmDatabaseRelease cmdlet to a folder or .zip file. The folder of .zip file contains the following resources:
- 'Update.sql': The SQL update script containing all the changes that will be made when Use-DlmDatabaseRelease is run with this DatabaseRelease object.
- 'Changes.html': Lists the database objects that will change as a result of running the 'Update.sql' script, and highlights SQL code differences for each object before and after the update. This report also includes changes to static data, shows warnings of any potential data loss and the SQL update script that will be run.
- 'Warnings.xml': Lists any warnings related to running the 'Update.sql' script.
- 'States/': Contains a representation of the state of each database before running the update and the desired state after the update.
- 'RedGateUpdateMetadata.xml': Contains metadata about the database deployment resources and the SQL Compare options used in comparisons.
- 'Filter.scpf': If SQL Compare filters are used when creating the database deployment resources, they are saved in this file.
Specify the output folder or file using the Path parameter. If the Path ends in .zip, the database deployment resources will be exported to a .zip file. Otherwise, they'll be exported to a folder. You can override this choice with the optional Format parameter.
Parameters
-InputObject
<RedGate.DLMAutomation.Compare.Domain.ReleaseArtifacts.IReleaseArtifact>
The DatabaseRelease object to be exported.
Aliases | None |
Required? | true |
Position? | 0 |
Default Value | None |
Accept Pipeline Input | true (ByValue) |
Accept Wildcard Characters | false |
-Path
<System.Object>
The path to the output folder or .zip file. If the path ends in ".zip", the Database Release is exported to a zip file. Otherwise it is exported to a folder. You can override this automatic choice using the Format parameter, and setting it to either "Zip" or "Folder" as required.
Aliases | None |
Required? | true |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-Format
<RedGate.DLMAutomation.Compare.Import.OutputFormat>
The output format of the Database Release. If you specify Zip, the Database Release will be exported to a .zip file. If you specify Folder, the Database Release will be exported to a folder. If you specify Default or don't use the parameter, the output format will be determined by the Path parameter.
Possible values: Default, Folder, Zip
Aliases | None |
Required? | false |
Position? | named |
Default Value | Default |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-Force
<System.Management.Automation.SwitchParameter>
Indicates that any existing output file or folder should be overwritten.
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
RedGate.DLMAutomation.Compare.Domain.ReleaseArtifacts.IReleaseArtifact
The DatabaseRelease object to be exported.
Return values
The output type is the type of the objects that the cmdlet emits.
- None
Examples
---------- EXAMPLE 1 ----------
|
This example shows how to create database deployment resources and export them to a folder.
The New-DlmDatabaseRelease cmdlet creates a DatabaseRelease object, which represents the database deployment resources. This object can update the database, Staging, to match the schema in the scripts folder C:\Work\scripts. The DatabaseRelease object is passed through the pipeline to the Export-DlmDatabaseRelease cmdlet. This cmdlet exports the database deployment resources to the folder C:\Export\DatabaseRelease\. The resources are exported to a folder because the Path parameter didn't end in .zip.
Exporting database deployment resources lets you review the update script and other update resources, such as the change report and deployment warnings.
---------- EXAMPLE 2 ----------
|
This example shows how to create a Redgate Database Release Artifact and export it to a folder.
---------- EXAMPLE 3 ----------
|
This example shows how to create a database deployment resources and export it to a .zip file.
The New-DlmDatabaseRelease cmdlet creates a DatabaseRelease object, representing the database deployment resources, which is passed through the pipeline to the Export-DlmDatabaseRelease cmdlet. This cmdlet exports the database deployment resources to a .zip file, because the Path parameter ended in .zip.
---------- EXAMPLE 4 ----------
|
This example shows how to create database deployment resources and export them to a .zip file using the Format parameter.
The Export-DlmDatabaseRelease cmdlet exports the database deployment resources to the .zip file, "C:\Export\DatabaseRelease.zip" because "Zip" is specified by the Format parameter. If the Format parameter wasn't used, the database deployment resources would be exported to a folder, because the Path parameter doesn't end in ".zip".