WebSphere Commerce Developer

Changing the development database type using the setdbtype command

After you install WebSphere Commerce Developer, the development environment is configured to use the Apache Derby database. To change the database type to DB2, Oracle, or back to Apache Derby, run the setdbtype command. Ensure that the database you are switching to exists in your network. Changing development database types does not carry over any schema customizations or custom data to the new database.

Note:

Before you begin

Procedure

  1. Stop the WebSphere Commerce Test Server.
  2. Stop the WebSphere Commerce development database.
  3. Go to the WCDE_installdir/bin directory.
  4. Run the following command to restore your WebSphere Commerce development database and workspace:
    restoreDefault.bat
    You now have the default environment with a Derby database.
  5. Run one of the following commands, depending on the database you are switching to:
    • DB2setdbtype db2 DB2_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort dbNode] [createdb]
    • Oraclesetdbtype oracle ORACLE_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort] [createdb]
    • Apache Derbysetdbtype cloudscape [createdb]
    • For IBM i OS operating systemsetdbtype iseries dbName dbHost dbUserID dbUserPassword [createdb]
      Note: The iSeries and createdb parameters are not variables. Type as iseries and createdb
    Where:
    DB2_HOME
    The root directory of DB2. For example, C:\IBM\SQLLIB
    ORACLE_HOME
    The root directory of the Oracle DBMS. For example, C:\oracle\product\11.1.0\client_1
    dbName
    The name of the database. For example, mall.
    dbAdminID
    The database administrator's ID. For example, db2admin or oracle.
    dbAdminPassword
    The associated password for dbAdminID
    dbUserID
    The database user ID that connects to the database.
    dbUserPassword
    The associated password for dbUserID
    dbHost
    Optional: The host name of a remote database server.
    dbServerPort
    Optional: The port number of the remote database server.
    dbNode
    Optional: The node name of the remote database.
    createdb
    Optional: If specified, the command creates a new empty database.
  6. After you run the setdbtype command, and before you publish any stores in the new database, run the resetstores command to clean the store database.
    1. Open a command prompt and change to the WCDE_installdir/bin directory.
    2. Run the following command:
      resetstores.bat
      Note: Running the resetstores script will remove all stores, including the starter stores published by default.
  7. If you are using a database that existed before the fix pack was installed, manually run the updatedb command.
    From a command prompt, run the following command:
    • Apache DerbyWCDE_installdir\bin\updatedb.bat cloudscape
    • DB2WCDE_installdir/bin/updatedb.bat db2 database_name database_user_name database_user_password
    • OracleWCDE_installdir/bin/updatedb.bat oracle database_name database_user_name database_user_password database_host server_port
    • For IBM i OS operating systemWCDE_installdir/bin/updatedb.bat iseries database_name database_user_name database_user_password database_host
    Where:
    database_name
    The name of your WebSphere Commerce Developer database. For example, WCDE_installdir/db/mall
    database_user_name
    The name of your WebSphere Commerce Developer database user.
    database_user_password
    The WebSphere Commerce Developer database user password.
    database_host
    The database server host name.
    server_port
    The database server host port number.
  8. Re-enable any features that you are using, see WebSphere Commerce feature packs.

    WebSphere Commerce DeveloperIntroduced in Feature Pack 2If you enabled search, rebuild the search index.

  9. Optional: If your database was customized to include custom columns or tables, you must update your database to include these changes.
  10. Verify that the script ran successfully by checking that the string BUILD SUCCESSFUL is at the end of the WCDE_installdir/logs/setdbtype.log log file

What to do next

Manually redeploy your store.