Sample: Extracting marketing data

This sample demonstrates how to extract marketing data from the WebSphere Commerce database, such as activities, e-Marketing Spots, customer segments, content, and associated attachments. This sample uses the Data Extract utility to extract the marketing data for a specific store. We can then use the Data Load utility to load the extracted data into another WebSphere Commerce instance or store to quickly copy marketing data between instances or stores.

Before beginning

Ensure that you complete the following tasks:


About this sample

When you run this sample, the Data Extract utility is configured to extract the marketing data for only the store that you specify. We can specify the store in the environment configuration file. The sample configuration files used to configure the Data Extract utility are in the following directory and subdirectories:

When you run this sample, the files extract the data for all marketing object types. The data for each object type is included in separate output files. By default, this sample extracts data into CSV formatted files. To export data into XML formatted files, we can edit the sample business configuration files to use a data writer that generates XML output files.


Sample configuration files

The following configuration files are used to configure the Data Extract utility to extract data into CSV output files.


Procedure

  1. Copy the sample configuration files and directories to a local directory.

  2. Edit your copy of the sample environment configuration files to set the configuration variables for the environment. All of the sample configuration files used in this sample include values for a default WebSphere Commerce Developer environment that uses an Apache Derby database. If the environment settings are different, change the configured values in these files to match the environment. For more information about updating an environment configuration file, see
    Configure and running the Data Extract utility.

  3. (Developer) On a command line, go to the WCDE_installdir\bin directory.

  4. (Linux) Open a command line in the Utility server Docker container. Change the directory to utilities_root/bin directory.
    For information about entering and leaving containers, see Running utilities from the Utility server Docker container.

  5. Enter the following command to run the sample data extract order configuration for extracting the marketing data:

    • (Linux) ./dataextract.sh ../samples/DataExtract/Marketing/wc-dataextract.xml

    • (Developer) dataextract ..\samples\DataExtract\Marketing\wc-dataextract.xml

When the utility completes the extraction process, the utility generates the output files within the configured output directory and subdirectories. These files include data for all marketing objects that exist for the configured store. By default, the files are generated in the following output directory and subdirectories:


Verifying results

  1. Go to the directory that you configured as the output directory. If we did not configure an output directory, go to the following directory:

  2. Verify that the following CSV output files are generated:

    • CustomerSegment/MemberGroup.csv

    • CustomerSegment/MemberGroupDescription.csv

    • CustomerSegment/MemberGroupCondition.csv

    • Attachment/Attachment.csv

    • Attachment/AttachmentDescription.csv

    • Attachment/AttachmentAsset.csv

    • Attachment/AttachmentAssetLanguage.csv

    • MarketingContent/MarketingContent.csv

    • MarketingContent/MarketingContentDescription.csv

    • MarketingContent/MarketingContentAttachment.csv

    • MarketingContent/MarketingContentAttachmentDescription.csv

    • MarketingContent/MarketingContentImageMap.csv

    • MarketingSpot/MarketingSpot.csv

    • MarketingSpot/MarketingSpotDefaultContent.csv

    • MarketingSpot/MarketingSpotDefaultTitle.csv

    • MarketingActivity/MarketingCampaign.csv

    • MarketingActivity/MarketingActivity.csv

    • MarketingActivity/MarketingElement.csv

    • MarketingActivity/MarketingElementNVP.csv

  3. Open the output files to review the file contents.

  4. Verify that the file contents match the data in the database for the marketing objects that belong to the specified store. For more information about the data that can be in these files, see
    Marketing object input file definitions.


What to do next

We can load your extracted data into another WebSphere Commerce instance with the Data Load utility. For a sample that demonstrates how to load marketing data, see Sample: Loading marketing data. When you follow this sample, edit the load order configuration file to specify the output files that were generated by the Data Extract utility.


Related concepts
Overview of the Data Extract utility