(Developer)
Export customer segments from the production database in a development environment
We can configure the WebSphere Commerce development environment so that we can export customer information from the production environment database. We can then use the customer information to help test any customization of the customer segment export feature.For more information about exporting customer segment information with the Marketing tool, see Exporting customer segment information.
Note: To export customer segment information in the development environment does not require a connection to the production environment database. When you run the export feature in the development environment and no connection to the production database exists, the feature exports the information from the development environment database. If you do not need to export information from the production environment, use the development environment database using the export feature without a production database connection.
Before beginning
Ensure that you complete the following tasks in the development environment:
- Create a user and assign the user the Marketing Director role. Only a Marketing Director can download a customer segment export file.
- Enable logging and tracing. For the Marketing tool, turn on the trace for the com.ibm.commerce.marketing.segment component.
Procedure
- Configure a connection to the production environment database.
- Synchronize the customer segments between the development and production environments.
- Ensure that the customer segments in the development environment to export exist in the production environment. If a segment that is being exported does not exist in the production environment, the generated export file does not include any data.
The customer segments to export need to have the same identifying values in both environments. For example, the MBRGRP.MBRGRP_ID value. The customer segment export uses the ID values in the development environment to create an SQL query to retrieve the customer segment information. By having the same values in both environments, we can ensure that the query retrieves data for the correct segment. If the ID values are different between environments, the query can fail to return information from the production environment database or return information for the wrong customer segment.
- Configure the customer segment export feature to use the production environment database connection.
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Go to the following directory:
workspace_dir\WC\xml\config\com.ibm.commerce.marketing-fep-ext If the com.ibm.commerce.marketing-fep-ext folder does not exist, create this folder.
- Open the wc-admin-component.xml file for editing. If this file does not exist, we must create this file. For more information about creating this file, see Changing properties in the marketing component configuration file (wc-admin-component.xml).
- Locate the Customer Segment Export section in the file and change the value of the CustomerSegmentExtractUseProductionConnectionInDeveloperEnv configuration property to be true.
- Save and close the file.
- Restart the WebSphere Commerce Test Server.
- Verify that the configuration is successful and that we can export customer segments from the production environment database.
- As a user that has the Marketing Director role, open the Marketing tool.
- Export the customer information for a customer segment and download the exported file.
- In a file management utility, go to the following directory:
WCDE_installdir\logs
- Open the trace.txt file for editing. This file includes the SQL statement that the customer segment export feature used to export the customer segment from the production environment database. Copy the SQL statement.
- Open a connection to our production database and run the copied SQL statement to view the information for the exported customer segment. Compare the contents of the downloaded export file with the database query results to verify that the file contents are for the correct customer segment in the production environment.
Related concepts
Customer segments
Related tasks
Adding a new customer segment attribute to Management Center
Adding a customer segment attribute to the customer segment export file
Customizing customer segments
Manage customer segments
Exporting customer segment information
Related reference
Customer segment attributes