Extracting marketing data with the Data Extract utility

You can configure and run the Data Extract utility from a command-line utility to extract marketing data for a store into CSV output files. You can then use the Data Load utility to load the extracted data into other WebSphere Commerce stores or instances.

Before you begin

Ensure that you complete the following tasks:
  • Verify that the store that you are extracting data from includes marketing data. If there is no data for the type of marketing object that you are extracting, the generated output file does not include any data.

About this task

By default, sample configuration files are provided for extracting the following types of marketing objects:
  • Activities
  • Campaigns
  • Customer segments
  • Content
  • E-Marketing Spots
  • Attachments
These files configure the Data Extract utility to extract data into CSV formatted output files. These output files are compatible with the Data Load utility for use as input files. If needed, you can edit the other sample configuration files to change how the utility retrieves, transforms, and outputs data. For more information about these sample files, see Sample: Extracting marketing data.
Notes:
  • The generated file does not include any columns or values for object unique IDs. These values are specific to the store or instance that the object is being extracted from. During an extract operation, the utility can replace some primary key values such as the unique IDs with the corresponding unique identifier value. The utility then outputs the identifier value instead of the unique ID. When you load the CSV file into a store with the Data Load utility, the utility resolves the unique ID for objects from the identifier value. Since the unique ID can be different between environments, a load operation can fail if you include unique ID values in your input file.
  • The utility extracts data for only a single store in each extract operation. You can specify the store identifier in the environment configuration file.
  • The utility does not extract any managed files for attachments. The utility only extracts the information that points to the managed files. If you plan to load attachments that have associated managed files, you must manually create the managed files in the target store by using the Assets tool. If you do not create the managed files before you load the attachment information, the load operation fails since the Data Load utility cannot resolve the unique ID values for the managed files.
  • The utility does not extract some associated data for activities. The utility does not extract email templates for email activities. If you need to copy the templates into another store, you must manually create the email templates.
  • WebSphere Commerce EnterpriseIf the stores that you are extracting data from and loading data into are extended sites stores, extract and load the asset store data first. Then, extract and load the data that belongs to the extended sites store.

Procedure

  1. Configure the Data Extract utility.
    When you are configuring the utility, copy the sample configuration files and directories for extracting marketing data to a local directory. Edit your copy of the sample configuration files to configure the utility for your environment. The sample files are in the following directory and subdirectories:
    • AIXLinuxWC_installdir/samples/DataExtract/Marketing
    • WindowsWC_installdir\samples\DataExtract\Marketing
    • WebSphere Commerce DeveloperWCDE_installdir\samples\DataExtract\Marketing
  2. Run the Data Extract utility to extract the marketing data for the configured store.
    1. Open a command-line utility and go to the appropriate directory:
      • AIXLinuxWC_installdir/bin
      • WindowsWC_installdir\bin
      • WebSphere Commerce DeveloperWCDE_installdir\bin
    2. Enter the following command to run the utility:
      • AIXLinux./dataextract.sh ../samples/DataExtract/Marketing/wc-dataextract.xml
      • Windowsdataextract.bat ..\samples\DataExtract\Marketing\wc-dataextract.xml
      • WebSphere Commerce Developerdataextract ..\samples\DataExtract\Marketing\wc-dataextract.xml
      When the utility completes the extraction process, the utility generates the output files for the object data within the data output location that you configured in the data extract order configuration file.

      You can configure the utility by including optional parameters in the command. For more information about the available parameters, see Data Extract utility

  3. Verify that the all of output files are successfully generated.
    1. Go to the directory that you configured as the output directory. If you did not configure an output directory, go to the following directory:
      • AIXLinuxWC_installdir/samples/DataExtract/Marketing/output
      • WindowsWC_installdir\samples\DataExtract\Marketing\output
      • WebSphere Commerce DeveloperWCDE_installdir\samples\DataExtract\Marketing\output
    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.

      Within each output CSV file, the first row of the file includes the object keyword. The second row includes the column headings. Each subsequent row includes the data for a single extracted object. The columns within the file are the same as the files that are needed to load the object data with the Data Load utility.

    4. Compare the contents of the file with the data in the source database tables to verify that the correct data is extracted.

What to do next

You can use the generated output files as input files with the Data Load utility to load your extract data into another WebSphere Commerce store or instance. For example, to quickly create multiple test environments. By extracting and loading your marketing data, business users do not need to re-create the objects with the Marketing tool in the target store or instance. After you load your extracted marketing data, the objects become available in the Marketing tool for the specified store. For more information about loading marketing data, see Loading marketing objects with the Data Load utility.
Tip: When you finish loading your extracted data, back up your input file before you run another marketing extract operation. When you run another extract operation, the Data Extract utility overrwrites the content of the file if the file name and directory location remain unchanged. You might need the older file contents if you need to delete or reload the data that you previously loaded.

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 files to configure the Data Load utility to load the files that were generated by the Data Extract utility.