Manually Configuring Remote Database with WCS Toolkit

Posted by Unknown on
The default configuration of WCS toolkit in version 7 comes with embedded Apache Derby database, in the older versions of WCS this used to be embedded cloudscape database, to configure your database with a remote database you would run the setdbtype command with the appropriate parameters.

setdbtype.bat oracle C:\oracle\10ghome wcs7 system system1 <username> <password> <DB IP> <DBPORT>

In this blog, I will provide some manual steps through which we can achieve the same configuration as performed by OOTB setdbtype command, although the steps were captured on toolkit, this should almost be the same on server environment as well, with the exception to path for certain configuration files.

Let us assume that you would have used following command if you had used setdbtype.
setdbtype.bat oracle C:\oracle\10ghome wcs7 system system1 wcs7 wcs7 <DB IP> <DBPORT>

Let us try the same through manual configuration.

The first thing we need to do is generate the encrypted password for Oracle "system" and WCS user database accounts.
This can be done by using "wcs_encrypt.bat" command, which is located in <WC_INSTALLDIR>\WCDE_ENT70\bin> folder

Copy the generated encrypted password from the command, example.
C:\IBM\WCDE_ENT70\bin>wcs_encrypt.bat system1
C:\IBM\WCDE_ENT70\bin>wcs_encrypt.bat wcs7


1. Edit the following file, <TOOLKIT_HOME>\WCDE_ENT70\workspace\WC\xml\config\wc-server.xml (in older versions, i.s < WCS 7, this file is located in <TOOLKIT_HOME>\confg\xml\config.xml), this is the instance XML file which we will edit for database configuration.
NOTE:  As a general note always take backup of any WCS configuration file before making any changes.

Look for the section "<Database>" in this XML.

a. Replace DBAName attribute with "system", the default value will be "APP"
    DBAName="system"
b. Replace  DB Password with the encrypted password which you generated using WCS "wcs_encrypt.bat" command for database "system" account, E.g.
    DBAPwd="x88CIfbcwJM="

c. Replace DBHost with the ipaddress or hostname of your remote database
    DBHost="192.168.1.1"

d. Replace DBMSName as "oracle", assuming your are configuring to a remote Oracle database. E.g
  DBMSName="oracle"

e. Replace DBServerPort with the remote database Listener Port E.g.
   DBServerPort="1521"

f. Replace DBUserID with your database username E.g
  DBUserID="wcs07"

g. Replace DBUserPwd with the encrypted password for remote WCS database.
  DBUserPwd="PImAx3Bl9mg="

h. Update Remote DB as RemoteDB="true"

i. Update service name with your remote DB service name E.g. ServiceName="wcs7"

j. Update the name attribute with the remote database name, E.g name="wcs7"

The final configuration will appear as shown below,
The highlighted texts were updated.


      <DB CreateDB="true"
        DBAHomeDir=""
        DBAName="system"
        DBAPwd="x88CIfbcwJM="
        DBHost="192.168.1.1"
        DBMSName="oracle"
        DBNode=""
        DBServerPort="1521"
        DBUserHomeDir=""
        DBUserID="wcs07"
        DBUserPwd="PImAx3Bl9mg="
        OraUserID=""
        RemoteDB="true"
        RunDB2SG="false"
        ServiceName="wcs7"
        StagingEnable="false"
        active="true" name="wcs7"/>
    </Database>

2. Look for the XML element "<WebSphere"
The highlighted texts were updated.

   <Websphere
      DatasourceName="WebSphere Commerce Oracle DataSource demo"
      HelpServerHostName="localhost"
      HelpServerPort="8001"
      JDBCDriverLocation="C:\oracle\10ghome\jdbc\lib\ojdbc6.jar"

3. Look for the XML element "DevTools"
The highlighted texts were updated

  <DevTools
    CommitCount="17000"
    ConnectionPoolSize="50"
    DefaultPublishPath="StoresWebModule"
    DeleteMasterXML="true"
    DeleteResolvedMasterXML="true"
    IDResolverCustomizerFile="OracleConnectionCustomizer"


4. The last step is to update the JDBC datasource for WCS Test environment which is used by the toolkit.

a. Make sure the Toolkit Test server is up and running.
b. Navigate to the WAS admin console , https://localhost:9043/ibm/console/
c. Logon to WAS admin console and navigate to Enterprise Application > WC  and look for "Application Scoped Resources" (hyperlink)

d. Look for a Datasource named "WebSphere Commerce Oracle datasource demo" and click on the link.

e. Update the Datasource helper and Database URL as per your remote database environment, E.g as shown in the screenshot below.


f. We need to additionally update the JAAS and Custom Properties as shown in the screenshot below.
first click on custom properties link and update the databaseName and portNumber properties.
Next click on the JAAS link and update the username and password for WCS user.





Update Custom Properties
 
 
Update JAAS Configuration

Save your configuration and restart the server.

Now restart your server and test your application with the remote database.

you can easily revert back the configuration to point to embedded database by executing following command "setdbtype.bat cloudscape", This command will point your toolkit back to the embedded database.

Although you will not perform these steps on a regular basis, but some of the points in this blog will help you to understand the internals of database configuration in WCS.


2 comments:

  1. There is no save option for step e.

    ReplyDelete
  2. how to do step e and f its not editable

    ReplyDelete