Creating Enhanced Deployment Packages

If, in addition to metadata, you wish to include entity data and report templates in a single deployment package, you need to create an enhanced deployment package. An enhanced deployment package is a .zip archive that bundles together metadata, entity data, and report templates in a standardized format.

The enhanced deployment package .zip archive must have the following structure:

Copy
Deployment_Package_Name.xml
Deployment_Package_Name
    DataConfigImport
        DataConfigImport.xml
        Data_Import_File.xlsx
        ...
        Another_Data_Import_File.xlsx
    ReportTemplates
        Report_Template_File.docx
        ...
        Another_Report_Template_File.docx

Deployment Package File

The deployment package file (Deployment_Package_Name.xml in the example above), contains the metadata exported from the source environment. For details, see Exporting a Deployment Package.

Deployment Package Folder

The deployment package folder name must match the deployment package file name without the extension (Deployment_Package_Name in the example above).

DataConfigImport Subfolder

The DataConfigImport subfolder contains the import data set files (Data_Import_File.xlsx and Another_Data_Import_File.xlsx in the example above) and a file called DataConfigImport.xml that maps the import data set files to the data import templates, and entities on the destination environment.

Import Data Set Files

For details on how to export the data set files (Data_Import_File.xlsx and Another_Data_Import_File.xlsx in the example above) from the source environment, see Data Exports.

DataConfigImport.xml File

The DataConfigImport.xml file maps the import data set files to the data import templates and entities on the destination environment:

Copy
<DataConfigImportSet xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="DataConfigImportName" version="1.0.1">
    <DataConfigImport dataImportTemplateName="AA01_DIT"  entityName="AA01_Ent" fileName="Data_Import_File.xlsx"       rollbackOnError="true"/>
    <DataConfigImport dataImportTemplateName="AA01_DIT"  entityName="AA01_Ent" fileName="Another_Data_Import_File.xlsx" rollbackOnError="true"/>
    <DataConfigImport dataImportTemplateName="AA01_DIT2" entityName="AA01_Ent" fileName="Data_Import_File_3.xlsx"       rollbackOnError="true"/>
    <DataConfigImport dataImportTemplateName="AA01_DIT2" entityName="AA01_Ent" fileName="Data_Import_File_4.xlsx"       rollbackOnError="true"/>
    <DataConfigImport dataImportTemplateName="AA01_DIT2" entityName="AA01_Ent" fileName="Data_Import_File_5.xlsx"       rollbackOnError="true"/>
</DataConfigImportSet>

If a file mentioned in the DataConfigImport.xml file is not found in the container folder and its rollbackOnError is set to true, the import is stopped. Files are uploaded in the order defined in the DataConfigImport.xml file.

ReportTemplates Subfolder

The ReportTemplates subfolder may contain report template files that are uploaded if they appear in a deployment package:

Copy
<Reports>
    <Report name="AA01_Report" displayName="AA01 Report" typeName="Document" scopeName="Entity" entityName="AA01_Ent" destinationFileName="AA01_ReportFile" destinationField="AA01_Ent_AttrFile" outputMethodName="Attach to entity" documentReportType="PDF" alwaysReturnFile="false" orderIndex="1" showInMenu="false" AllowEdit="false" AllowDelete="false"><![CDATA[        ]]>
    <ReportParameters />
    <ReportItems>
        <ReportItem isDefault="true" name="AA01_Report : 1/3/2020 - 3/3/2020" reportName="AA01_Report" reportEntityName="AA01_Ent" startDate="2020-02-29T22:00:00.0000000" endDate="2020-03-02T22:00:00.0000000" AllowEdit="false" AllowDelete="false">
        <DocumentReport name="AA01_ReportDoc" dataSourceType="entity" language="English" AllowEdit="false" AllowDelete="false">
            <Template>[{"Name":"DocTemplate.docx","RealName":"DocTemplate_aac79c6c-61bf-4515-8328-5d38a9f387ab.docx"}]</Template>
            <fetchCollection />
        </DocumentReport>
        </ReportItem>
    </ReportItems>
    </Report>
</Reports>
<DocumentReports>
    <DocumentReport name="AA01_ReportDoc" dataSourceType="entity" language="English" AllowEdit="false" AllowDelete="false">
    <Template>[{"Name":"DocTemplate.docx","RealName":"DocTemplate_aac79c6c-61bf-4515-8328-5d38a9f387ab.docx"}]</Template>
    <fetchCollection />
    </DocumentReport>
</DocumentReports>

If a report template file is mentioned in the deployment package, it is searched in the ReportTemplates folder and, if found, uploaded before the Document Report import. The template is imported with the real name created upon that upload. This is because files are uploaded/stored with a modified name called real name obtained by adding a Guid like suffix which ensures its uniqueness.