Copying marketing statistics from the production environment

Typically, statistics regarding how customers are using your site are captured on the production environment. A system administrator can transfer that data from the production environment to the development or staging environment for analysis by running a series of commands, whenever the information is required.

Attention: Instead of following the procedure in this topic, you can use the DownloadStatistics scheduled job to transfer your marketing and search rule statistical data from your production environment to your staging environment. For more information, see Scheduling the DownloadStatistics job to copy marketing and search statistics.

Procedure

  1. Enter the Utility server Docker container on the production environment.
  2. Run the ExportStats command:
    ./ExportStats.sh -Ddatabase_type -Ndatabase_name -Udatabase_user_id 
          -Pdatabase_password -Foutput_file_name -Ttable_name
    Where:
    database_type
    The type of database you are using, DB2, or Oracle.
    database_name
    • DB2The name of your database. This name identifies the host name of the database server, the port number of the server, and the system ID. -Njdbc:db2://db:serverport/dbname where db2 is the database type, db is the server name, serverport is the database server port number, and dbname is the name of the database. For example,
      -Njdbc:db2://db:50000/mall 
      where "db2" is the db type, "db" is the server name, "50000" is the db port, and "mall" is the dbname.
    • OracleIdentify the database using the following format: hostname:port:sid identifying the host name of the database server, the port number of the server, and the system ID.
    database_user_id
    The user ID of the database owner.
    database_password
    The password for the database owner ID.
    output_file_name
    The path and name of the output file with an .xml extension (if no path is specified, the default is the current directory).
    table_name
    The name of the database table that you want to export. The table to export depends on your requirements from among the following choices:
    • DMELESTATS for Web activity and experiment statistics
    • DMEMSPOTSTATS for e-Marketing Spot statistics
    • DMEXPSTATS for experiment statistics
    • SRCHSTAT for search statistics

    This creates an XML file.

    DB2For example, use the following format with DB2:
    ./ExportStats.sh -DDB2 -Njdbc:db2://db:50000/mall -Uwcs -Pwcs1 -Fsearchdata.xml -Tsrchstat
  3. Transfer the XML file to the runtime development or staging environment Utility server Docker container.
    • /opt/CommerceServer90/bin
  4. Run the ImportStats command by entering the following:
    ./ImportStats.sh -Ddatabase_type -Ndatabase_name -Udatabase_user_id 
          -Pdatabase_password -Finput_file_name
    Where
    database_type
    The type of database you are using, DB2, or Oracle.
    database_name
    The name of your database. This name identifies the host name of the database server, the port number of the server, and the system ID. -Njdbc:db2://db:serverport/dbname where db2 is the database type, db is the server name, serverport is the database server port number, and dbname is the name of the database. For example,
    -Njdbc:db2://db:50000/mall 
    where "db2" is the db type, "db" is the server name, "50000" is the db port, and "mall" is the dbname.
    DB2For DB2, an example command would be:
    ./ImportStats.sh -DDB2 -Njdbc:db2://db:50000/mall -Uwcs -Pwcs1 -Fsearchdata.xml -Tsrchstat

    Oracle Identify the database using the following format: hostname:port:sid identifying the hostname of the database server, the port number of the server, and the system ID.

    database_user_id
    The user ID of the database owner.
    database_password
    The password for the database owner ID.
    input_file_name
    The path and name of the output file that is created with the ExportStats utility in step 2 (if no path is specified, the default is the current directory).

Results

This deletes any statistical information in the development or staging environment database, and imports the statistics.