Websphere Commerce: Replace database / Plug in new data

By | February 16, 2014

In Websphere Commerce environments it is relatively easy to replace entire database with new database.

This is typically useful if you want to copy test data from one environment to another environment. You can take copy / database dump of the database, restore it in your target environment and then configure the target environment to use this restored DB with minimal changes to the environment

Steps involved in replacing Websphere Commerce database

  1. Take a DB dump of the database you want to use.
  2. Restore the DB dump (preferably under existing DB listener / SID) in target environment.
  3. Change WAS Admin console configurations at two places
    1. JDBC datasoruce for Websphere Commerce
      • Also change corresponding authentication alias configurations if required, however if you are following standard environment creation approach for all you environments then this should be necessary.
    2. JDBC datasoruce for Websphere Commerce Search / solr.
      • Also change corresponding authentication alias configurations if required, however if you are following standard environment creation approach for all you environments then this should be necessary.
  4. In the new database look for following two table. These tables contain environment specific values (hostname for search url, and port number for search url). Update these tables to match the values of target environment. These tables are small and will not take more than few minutes to update these.
  5. Now restart your Websphere Commerce and Search JVMs (Application servers). In clustered or Network deployment environment, it is better to restart Deployment manager and node agents as well, however not entirely necessary.

Known Issues after replacing database in Websphere Commerce environment

After these steps you’ll find that your online store is updated with new data. However you Websphere commerce admin consoles (such as Commerce Accelerator or Organization Administration Console) may not work. Same goes for secure Web services which Websphere Commerce might be exposing (consumed by other integrating applications). This is because the User ID and Passwords for these are stored in the database and you have just changed the database. This can be fixed in two ways

  1. If you know the user ID/Passwords for WC environment from where the data was copied and the value of ‘merchant key’ is same for both the environments then you can use the same user IDs and Passwords in the target environment.
  2. But the better approach is to reset the passwords for user IDs and create new user IDs as required using Websphere Commerce Admin Console. For the Primary WC Admin ID, however, you’ll need to follow this process in Infocenter to reset its password.

Be aware …

This process was tested successfully with Websphere Commerce environments using DB2. I would not recommend trying this in Critical / Production environments. Websphere Commerce provides data import utilities which are suggested by IBM Support.

Always … Always take proper backups so that you have restore points to fall back on.