Extracting promotion data with the Data Extract utility
You can configure and run the Data Extract utility from a command line utility to extract the promotion data for a store into an XML file. You can then use the Data Load utility to load the promotion XML file into stores in other environments, such as for testing the promotion in multiple test environments.
About this task
When you run the Data Extract utility to extract promotion data, the utility uses the PromotionToDomTransformMediator mediator to retrieve promotion data from the database and build a DOM object for the promotions. The DOM object is then passed to the data writer, which generates the output XML file that includes the extracted data. The generated promotion XML format is completely different from the promotion runtime XML. The generated promotion XML format is similar to the promotion authoring XML. The generated output XML differs from the authoring XML in that during the extraction process, the Data Extract utility replaces some primary key values (for example, for categories, catalog entries, customer segments) with the corresponding unique identifier value. The utility outputs the identifier value instead of the unique ID, since the unique ID can be different between environments. When you load the XML into a store with the Data Load utility, the utility resolves the unique ID for the promotions from the identifier value.
To use the Data Extract utility promotions, sample configuration files are provided for you to edit and use to quickly configure the utility. These files configure the utility to extract data for all promotions in the configured store.
Procedure
-
Configure the Data Extract utility.
When you are configuring the utility, copy and edit the sample configuration files for extracting promotion data. These files are in the following directory and subdirectories:
- WCDE_installdir\samples\DataExtract\Promotion
- Optional:
When you are configuring the utility, open the business object configuration file
(wc-extract-xml-promotion.xml) for editing and configure the settings for
extracting promotion data.
By default the Data Extract utility uses the PromotionToDomTransformMediator mediator to extract and output the following information for a promotion:
- The identifying and general properties for a promotion. These properties include the promotion
name, start date, end date, priority, exclusivity, and more. The information is included within the
<Base>
XML element of the generated output file. If the promotion that is being extracted has a public promotion code, that code is included in this section of the output file. No information about any generated unique promotion codes is included.The configuration to extract this information is defined in the
<_config:BusinessObjectMediator>
element of the business object configuration file. - The promotion description, which is included in the
<Description>
XML element in the generated output file. A separate<Description>
element is included for each defined language for the promotion. The utility extracts this information from the PX_DESCRIPTION database table.The PromotionToDomTransformMediator mediator includes the configuration to extract this type of data. You cannot customize the data that returns in this group of information.
- The promotion target and purchase conditions, which are included in the
<Elements>
XML element in the generated output file. The utility extracts this information from the PX_ELEMENT and PX_ELEMENTNVP database tables. Each name-value pair for a promotion from the PX_ELEMENTNVP table is included as a separate XML element name and value. This name-value pair XML element is within the appropriate parent XML element from the extracted PX_ELEMENT data.The PromotionToDomTransformMediator mediator includes the configuration to extract this type of data. You cannot customize the data that returns in this group of information.
- The identifying and general properties for a promotion. These properties include the promotion
name, start date, end date, priority, exclusivity, and more. The information is included within the
- Run the Data Extract utility to extract the promotion data for the configured store.
-
Verify that the Promotion.xml output XML file generated
successfully.
- Go to the data output location and open the generated XML output file to review the file contents.
- Compare the contents of the file with the promotion data in the source database tables to verify that the correct data is extracted.
What to do next
You can also edit the promotions in the output file and load the data back into the same store to update the store promotions. For more information about loading a promotion XML input file with the Data Load utility, see Loading promotions with the Data Load utility.