Copying customer segments from the production server to the staging server

When marketing managers export a profile segment from IBM Digital Analytics, formerly known as Coremetrics Analytics, the resulting WebSphere Commerce customer segment is stored in the production server database. These customer segments must be copied to the staging server database so that they are available to marketing managers when creating marketing activities and promotions in Management Center and WebSphere Commerce Accelerator. WebSphere Commerce provides a command-line utility that you can use to copy the customer segments from one server to the other.

About this task

Run the customer segment copy utility from the staging server.

Procedure

  1. Open a command prompt window.
  2. LinuxAIX Ensure that you run the customer segment copy utility as the wasuser user. To do so, issue the following command:
    su - wasuser_ID where wasuser_ID is the non-root user ID created before installing WebSphere Commerce. The default WebSphere Application Server user name is wasuser.
  3. Run the customer segment copy utility with the following command:
    • WindowsWC_installdir/bin/segmentcopy.bat -dbType databaseType -prodDb productionDatabase -prodDbUser productionDatabaseUser -prodDbPasswd productionDatabasePassword -prodSchema productionSchema -stagDb stagingDatabase -stagDbUser stagingDatabaseUser -stagDbPasswd stagingDatabasePassword -stagSchema stagingSchema -fromDate fromDate
    • LinuxAIXWC_installdir/bin/segmentcopy.sh -dbType databaseType -prodDb productionDatabase -prodDbUser productionDatabaseUser prodDbPasswd productionDatabasePassword -prodSchema productionSchema -stagDb stagingDatabase -stagDbUser stagingDatabaseUser -stagDbPasswd stagingDatabasePassword -stagSchema stagingSchema -fromDate fromDate
    -dbType
    • LinuxAIXWindows(Required) Specify DB2.
    • For IBM i OS operating system(Required) Specify one of the following values:
      DB2/OS400
      Specify DB2/OS400 when using the native JDBC driver.
      DB2/OS400ToolBox
      Specify DB2/OS400ToolBox when using the IBM toolbox for Java JDBC driver.
    • OracleSpecify Oracle.
    -prodDb
    (Required) The name of the database on the production server. Use the following format for the name:
    db_server:db_port/db_name
    -prodDbUser
    (Required) The database user name to connect to the production database.
    -prodDbPasswd
    (Required) The password for the specified -prodDbUser user name.
    -prodSchema
    The name of the schema for the production database. This parameter is required if your site uses a schema name that is different from the default schema name created for the production database. If you do not specify this parameter, the utility uses the default schema name for the production database, WCS. You can check the schema name by viewing the schemaName variable in the following file:
    WC_installdir/instances/instanceName/properties/createInstance.properties
    -stagDb
    (Required) The name of the database on the staging server. Use the following format for the name:
    db_server:db_port/db_name
    -stagDbUser
    (Required) The database user name to connect to the staging database.
    -stagDbPasswd
    (Required) The password for the specified -stagDbUser user name.
    -stagSchema
    The name of the schema for the staging database. This parameter is required if your site uses a schema name that is different from the default schema name created for the staging database. If you do not specify this parameter, the utility uses the default schema name for the staging database, WCS. You can check the schema name by viewing the schemaName variable in the following file:
    WC_installdir/instances/instanceName/properties/createInstance.properties
    -fromDate
    (Required) Specifies the customer segments to copy, based on their created date or changed date, whichever is more recent. The utility copies all customer segments created or changed since the date, and optionally, the time you specify. Use either of the following formats for the -fromDate parameter:
    • mm/dd/yyyy
    • mm/dd/yyyy-HH.mm.ss
    For example, if today is July 1, 2011, and you want to copy all customer segments created or changed since yesterday at 1 p.m., specify the following -fromDate value:
    06/30/2011-13.00.00
  4. Review the messages in the command prompt window to monitor the export. There is no log file for this utility.

Example

The following is an example of a command-line entry to run the utility:
segmentcopy -dbType DB2 -prodDb pserver:50000/WCS -prodDbUser wcsuser -prodDbPasswd wcsuser1 
-stagDb sserver:50000/WCS -stagDbUser wcsuser -stagDbPasswd wcsuser1 -fromDate 10/01/2010-09.00.00