Extracting Commerce Composer data with the Data Extract utility
You can configure and run the Data Extract utility from a command-line utility to
extract Commerce Composer data for a store
into CSV output files. You can then use the Data Load utility to load the extracted data
into stores in other environments, such as for testing purposes. By using these utilities to copy
data between instances, business users do not need to manually create the same assets across
multiple instances.
Before you begin
- Verify that the store that you want to extract data from includes Commerce Composer objects to extract. If there is no data for the object in the store, the output files that the utility generates do not include any data.
Note: If you plan to load the extracted data into another instance, the store that you want to
load data into must have the Commerce Composer tool enabled.
About this task
When you are configuring the Data Extract utility to extract Commerce Composer data, you can extract data for the
following types of Commerce Composer
objects:
- Layouts
- Layout templates
- Widgets
- Widget multi-lingual descriptive information
- Pages
- Page multi-lingual SEO information
Sample configuration files are provided for you to edit and use to quickly configure the utility.
The sample configuration files are in the following directory:
- WCDE_installdir\samples\DataExtract\CommerceComposer
Notes:
- The sample configuration files configure the utility to extract data for a single Commerce Composer object type in a single operation.
To extract data for all Commerce Composer
object types, you must run the utility repeatedly, once for each object type.If you plan to load extracted data for multiple Commerce Composer object types into another instance, the data for one object type might overwrite the data for another object type. This replacement of data can cause data for some object types to be missing after you load the data for all object types. To ensure that all data is available in your target database, extract and load the data for one object type at a time in the following sequence:
- Layouts
- Layout templates
- Widgets
- Widget multi-lingual descriptive information
- Pages
- Page multi-lingual SEO information
- When you use the utility with sample files to extract information in multiple languages, the utility generates 2 output files. 1 file includes the data in only the store language that is configured in the business context attribute of the environment configuration file. The second file includes the data for the configured language and all other languages.
- The Data Extract utility extracts data for
only a single store in each extract operation. You can specify the store in the environment
configuration file.
If your site uses an extended sites store model, you cannot extract data for all extended site stores at once. If you want to extract and load asset store objects to extended sites stores, you must load the data into each extended site store individually.
- 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 external identifier value. The utility then outputs the external identifier value instead of the unique ID number. When you load the CSV file into a store with the Data Load utility, the utility resolves the unique ID for objects from the external identifier value. Since the unique ID number can be different between environments, a load operation can fail if you include unique ID values in your input file.
- The sample configuration files configure the Data Extract and Data Load utilities to extract and load all data for a Commerce Composer object type. If you want to load specific extracted data for an object type, you can configure the Data Load utility to load only specific load items. Use the -DLoadOrder parameter when you run the Data Load utility to identify the specific load item or items to load. If you want load multiple load items, include the list of load item names in comma-separated list that is enclosed in double quotation marks. For example, if you want to load only extracted widget restriction group data, you can extract all Commerce Composer template data and then run the Data Load utility to load the template data with the following configuration parameters to load the wireframe slot definition and widget registration data: -DLoadOrder="RegisterWidgetDef, WidgetSlot"
Procedure
-
Configure the Data Extract utility.
When you are configuring the utility, copy the sample configuration files and directories to another local directory. Edit and use your copy of the sample configuration files. These sample files are in the following directory and subdirectories:
- utilities_root/samples/DataExtract/CommerceComposer
- WCDE_installdir\samples\DataExtract\CommerceComposer
- For layouts, use the wc-dataextract-layout.xml configuration file.
- For layout templates, use the wc-dataextract-template.xml configuration file.
- For widgets, use the wc-dataextract-widget.xml configuration file.
- For pages, use the wc-dataextract-page.xml configuration file.
-
Run the Data Extract utility to extract
the data for the Commerce Composer object
for the configured store.
-
Verify that all of output files are successfully generated.
What to do next
You can use the generated output files as input files with the Data Load utility to load the data into another
HCL Commerce store or instance to quickly create or replace Commerce Composer objects in the other stores or
instances. For example, to set up multiple testing environments that include the same data, such as
for testing the display of new layouts or widget functionality on the storefront. You can also load
the data to copy objects between stores or instances when business users need to include those
objects on store pages in the target stores or instances. By extracting and loading Commerce Composer objects, developers and business
users do not need to re-create the objects with the Commerce Composer tool in each store or instance.
After you load your extracted data into a new environment, the objects become available in the
Commerce Composer tool for the specified
store.
Notes:
- When you load your extracted Commerce Composer data, ensure that you load the data in the correct sequence.
- For widgets and page information that is in multiple languages, load the information in the default store language first. Then, load the data in other languages. By loading the information in the default language first, you can reduce the risk of errors during the load operation. You can specify the default language in the environment configuration file business context.
- The Data Extract utility does not extract any assets that are associated with Commerce Composer objects, such as images, marketing content, or multimedia. If you load extracted Commerce Composer data into another instance, copy or move any associated assets for the Commerce Composer objects into the target instance. If you do not copy or move the assets, the Commerce Composer objects that you load might not display or function correctly.
Tip: When you finish loading your extracted data, back up the file before your
run another extract operation for the same type of object. You might need the older file if you need
to delete or reload the data that you previously loaded. When you run an extract for the same object
type, the Data Extract utility overwrites the
content of the output file if the file name and directory location remain unchanged.
For samples that demonstrate how to load data for each type of Commerce Composer object, see Commerce Composer samples. When you follow these samples, edit the load order configuration files to configure the Data Load utility to load the files that were generated by the Data Extract utility.