HCL Commerce Version 9.0.0.5 or later

Loading the HCL Commerce database schema

You need to use a script to load the HCL Commerce database schema.

Before you begin

Prepare an Oracle database for use with HCL Commerce.

About this task

This script completes the following tasks:
  • Creates the HCL Commerce schema including tables, views, and stored procedures in the database.
  • Loads bootstrap data.
  • Creates two default users in the database.
    wcsadmin
    The site administrator.
    spiuser
    The internal user with the role "RemoteConfigurationReaders". This user is used for inter-component server API invocation only. The spiuser user is configured in Store server, Search server and Customization server, and is used in the API invocation from those servers to the Transaction server. This user cannot be disabled. In the event that this user is disabled, the necessary component servers cannot connect to the Transaction server.

Procedure

  1. Log on to the dedicated server that is hosting the Utility server Docker container.
    If a Utility server Docker container is not deployed, see Preparing a Docker host server to launch Utility server Docker container.
  2. Enter the Utility server Docker container.
    For example,
    docker exec -it utility_container_name bash
  3. Go to the /opt/WebSphere/CommerceServer90/bin directory.
  4. Run the following command to create the HCL Commerce database schema.
    • For Linux:
      ./initdb_oracle_sample.sh staging|production dbName dbServer dbPort dbaUser dbaPassword dbUser dbPassword merchantKey wcsadminSalt wcsadminPassword spiuserSalt spiuserPassword sampleData|noSample [sslKeyFile sslKeyPassword]
    • For Windows:
      ./initdb_oracle_sample.bat type dbName dbServer dbPort dbaUser dbaPassword dbUser dbPassword merchantKey wcsadminSalt wcsadminPassword spiuserSalt spiuserPassword withSample sslKeyFile sslKeyPassword
    The following example displays the command to create a staging database and include sample data for the sample Aurora store:
    ./initdb_oracle_sample.sh staging orclpdb1 mydb.hcl.com 1521 system diet4coke wcs wcs1 1a1a1a1a1a1a1a1a2b2b2b2b2b2b2b2b 3h8x876vd8g3 wcs1admin 7j2lhm2vjpoc QxV7uCk6RRiwvPVaa4wdD78jaHi2za8ssjneNMdu3vgqi sampleData /opt/utilities/config/keystore.jks ibmkey
    type
    The type of environment. Valid values are staging or production.
    staging
    Specify this value if you want to enable workspaces. The default workspace number is five. The script create five Read schema and write schema in the database.
    production
    Specify this value if you do not want to enable workspaces and load a schema for production.
    dbName
    The name of the database that you created.
    dbServer
    The database server hostname.
    dbPort
    The database server port.
    dbaUser
    The database administrator username.
    dbaPassword
    The database administrator password.
    dbUser
    The database username. Ensure that you are not using the same username as the database administrator.
    dbPassword
    The database user password.
    merchantKey
    A plain text unencrypted merchant key.
    • A 32 hexadecimal character must be used. Characters can be one of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, or f.
    • Must contain a minimum of one alphabetic character.
    • Must contain a minimum of one numeric character.
    • Must be in lowercase.
    • Cannot contain more than 4 identical consecutive characters.

      For example, 1a1a1a1a1a1a1a1a2b2b2b2b2b2b2b2b.

    Important: You must specify your own merchant key and key encryption key values for the security of your HCL Commerce installation. Do not use the default values contained within the provided sample configuration files and documentation examples.
    wcsadminSalt
    Specify a random string to use to encrypt the wcsadminPassword.
    wcsadminPassword
    This script creates a Site Administrator user named wcsadmin. Specify a password for wcsadmin. Use the username wcsadmin and this password to log in to HCL Commerce tools such as Management Center, HCL Commerce Accelerator, and Administration Console.
    spiuserSalt
    Specify a random string to use to encrypt the spiuserPassword.
    spiuserPassword
    This script creates an SPI user named spiuser. Contact your administrator who prepared the Docker images in your registry. Use the same plain text spiuserPassword that your administrator used when preparing the Docker images. For more information, see Setting the spiuser password in your Docker images.
    This user is used for inter-component server API invocation only. The spiuser is configured in the Store server, Search server and Customization server, and is used in the API invocation from those servers to the Transaction server. This user cannot be disabled, otherwise the component servers cannot connect to the Transaction server.
    withSample
    Determine whether you want to load sample data for the Aurora sample store. Valid values are sampleData or noSample.
    sampleData
    Load sample data for the Aurora sample store. Specify this value if you want to view the Aurora sample store for learning purposes or to use the store as a validation point. At the end of the set up procedure, if you can view a functional store, then the environment installed correctly. If you specify sampleData, sample catalog data and images are loaded into your database. The following sample stores are loaded:
    • ExtendedSitesHub
    • ExtendedSitesCatalogAssetStore
    • AuroraStorefrontAssetStore
    • AuroraESite
    • AuroraB2BStorefrontAssetStore
    • AuroraB2BESite
    noSample
    Do not load any sample data. Specify this value when you will create your own store.

    To learn how to populate your own data, see Creating and configuring your custom store.

    sslKeyFile
    (Optional) If SSL support is configured on the database server, specify the path to the SSL key file. You might want to contact your database administrator to find out whether SSL support is configured.
    For example, to create a staging database and include sample data for the sample Aurora store:
    ./initdb_oracle_sample.bat staging orcl mydb.hcl.com 1521 system manager wcs wcs1 1a1a1a1a1a1a1a1a2b2b2b2b2b2b2b2b wcsadminSalt1 wcsadminPwd1 spiuserSalt1 passw0rd sampleData opt/utilities/config/keystore.jks hclkey
    Attention: This script takes approximately 30 minutes to complete. If the script fails, you must restore your database before you attempt to rerun the command.

    For more information about how to restore your database, see RESTORE DATABASE COMMAND for DB2, or Oracle Database 12c Release 2 for Oracle.

  5. Change the HCL Commerce default merchant key and key encryption key with your own values.
    1. Run wcs_encrypt.sh to encrypt the plain text merchant key.
      ./wcs_encrypt.sh merchantKey KeyEncryptionKey
      merchantKey
      The same plain text unencrypted merchant key that you used when you ran initdb_db2_sample.
      KeyEncryptionKey
      Specify your custom, plain text, 32 hexadecimal character key in the following file: /opt/WebSphere/AppServer/profiles/default/installedApps/localhost/ts.ear/xml/config/KeyEncryptionKey.xml
      For example,
      ./wcs_encrypt.sh 1a1a1a1a1a1a1a1a2b2b2b2b2b2b2b2b 3c3c3c3c3c3c3c3c4d4d4d4d4d4d4d4d
    2. Copy the ASCII encrypted string and make it accessible to your deployment. This key is required to start the Transaction server.
      • For a Kubernetes deployment, store the value depending on how environment values are provided to the deployment:
        • Within Vault, store the value at the Tenant/EnvName/EnvType/merchantKeyEncrypted key path.

          For more information, see Environment data in Vault.

        • Within the deployment values.yaml configuration file, store the value by uncommenting the following line.
          #merchantKey:ASCII_encrypted_string
      • For a Docker-based deployment:
        • Add the environment variable MERCHANTKEY_ENCRYPT into your docker-compose configuration file, docker-compose.yml, within the Transaction server environment configuration.
          For example:
          txn:
          environment:
            - MERCHANTKEY_ENCRYPT=ASCII_encrypted_string
        • If you are starting your Docker containers manually, you can also pass the string through command line.

          For example:

           docker run -d -e LICENSE=accept -e MERCHANTKEY_ENCRYPT=ASCII_encrypted_string
  6. HCL Commerce Version 9.0.0.1 only Run the updatedb utility if you are using HCL Commerce Version 9.0.0.1 Docker containers.

    You do not have to run the updatedb utility if you are using any other version.

Results

The HCL Commerce schema is loaded into your database.