UpdateVersionSchema utility

The UpdateVersionSchema utility identifies which tables to be versioned, and then creates the tables in your version schema. This utility replicates newly added tables marked to be versioned from the base schema into the version schema.

Note: Only the primary key, and unique indexes from the original table in the base schema are replicated in the table that is created in the version schema.

To determine which tables to create in the version schema, the updateVersionSchema utility searches all the service module directories for the content version configuration file (wc-content-version.xml). For any tables listed in the wc-content-version.xml file, the updateVersionSchema utility looks up the existing table in the WebSphere Commerce base schema, and then creates a corresponding table in the version schema. If the table listed in the wc-content-version.xml file is not found, an exception is reported. For more information about the wc-content-version.xml file.

If workspaces is enabled, you must run this utility to update the workspace schemas.

Note: You must run this utility when you customize any of the tables that are listed in the wc-content-version.xml file or when you make any schema-related updates to the list of versionable tables in the base schema.

Running the updateVersionSchema utility

  • To run the updateVersionSchema utility in the runtime environment, from the WC_installdir/bin directory, issue the following command:
    • LinuxAIX
      
      ./config_ant.sh -buildfile WC_installdir/migration/components/content-version/xml/updateVersionSchema.xml
      -DinstanceName=instance_name -DdbUserPassword=db_password 
      -DWCInstallDir=WC_installdir -Dwashome=WAS_installdir 
      [-DgeneratSQLStatementOnly=generatesqlstatementonly] [-DdebugMode=debug_mode] 
      [-DgenerateVersionSQLStatementsOutputFile=logfile_pathname]
    • For IBM i OS operating system
      
      ./config_ant.sh -buildfile WC_installdir/migration/components/content-version/xml/updateVersionSchema.xml
      -DinstanceName=instance_name -DdbUserPassword=db_password -DdbaPassword=dba_password 
      -DWCInstallDir=WC_installdir -Dwashome=WAS_installdir 
      [-DgeneratSQLStatementOnly=generatesqlstatementonly] [-DdebugMode=debug_mode] 
      [-DgenerateVersionSQLStatementsOutputFile=logfile_pathname]
    • Windows
      
      ./config_ant.bat -buildfile WC_installdir/migration/components/content-version/xml/updateVersionSchema.xml
      -DinstanceName=instance_name -DdbUserPassword=db_password -DdbaPassword=dba_password 
      -DWCInstallDir=WC_installdir -Dwashome=WAS_installdir 
      [-DgeneratSQLStatementOnly=generatesqlstatementonly] [-DdebugMode=debug_mode] 
      [-DgenerateVersionSQLStatementsOutputFile=logfile_pathname]
    Use the following parameters for this utility:
    -DinstanceName
    Required: The name of the instance to be updated (for example, demo).
    -DdbUserPassword
    Required: The password for the WebSphere Commerce user that is connecting to the database.
    LinuxAIXWindows-DdbaPassword
    LinuxAIXWindowsRequired: The password for the database administrator that is connecting to the database.
    -DWCInstallDir
    The WebSphere Commerce installation directory (for example, WC_installdir).
    -Dwashome
    The WebSphere Application Server home directory (for example, WAS_installdir.
    -DgeneratSQLStatementOnly
    Optional: The default value is false. Setting this parameter to true generates an SQL log file, but does not run the SQL statements. The database administrator can use the SQL statements that are generated in the log file to update the version schema manually.
    -DdebugMode
    Optional: The default value is false. Setting this parameter to true generates a log file in WC_installdir/logs/Application.version.update.messages_timestamp.log. The timestamp is appended to the file name, for example, Application.version.update.messages_yyyy.mm.dd_hh.mm.ss.zzz.log.
    -DgenerateVersionSQLStatementsOutputFile
    Optional: Specify a path and name for the log file. If you do not specify this parameter, the default name WC_installdir/logs/Update_version_db_instance_name.sql.log is used.
  • To run this utility in the toolkit environment, from the WCDE_installdir\bin directory, issue the following command in the command line: WebSphere Commerce Developer
    • updateVersionSchema.bat [-debug] [SQLlog_fullpathname]
    -debug
    Optional: Specify this parameter to generate the trace log file: WCDE_installdir\logs\Application.version.update.messages_timestamp.log. The timestamp is appended to the file name, for example, Application.version.update.messages_yyyy.mm.dd_hh.mm.ss.zzz.log.
    SQLlog_fullpathname
    Optional: When you specify the SQL log file name, the SQL statements are generated but not run. The database administrator can use the SQL statements that are generated in the log file to update the version schema manually.
    The following log files are generated by default in the toolkit environment:
    • WCDE_installdir\logs\Update_version_db_demo.sql.log (SQL file contains SQL statements to update the version schema)
    • WCDE_installdir\logs\updateVersionSchema.log.

Examples

This following example shows how to use the updateVersionSchema utility in the runtime environment:


./config_ant.bat -buildfile C:/WebSphere/Commerce/migration/components/content-version/xml/updateVersionSchema.xml 
-DinstanceName=demo -DdbUserPassword=wcs1 -DdbaPassword=manager -DWCInstallDir=C:/WebSphere/Commerce -Dwashome=C:/WASHome
The following example shows how to use the updateVersionSchema utility in the development environment:
updateVersionSchema.bat -debug C:\WCToolkit\UpdateVersionSchema.sql.log 

Limitations

  • The updateVersionSchema utility replicates only the primary key, and unique indexes into the newly created table in the version schema, no other table definitions are created. For example, the table constraints are not replicated.