To migrate your IBM Websphere Commerce Version 8 store to HCL Commerce Version 9.0,
export your Stores project from your IBM Websphere Commerce Version 8,
then import the project into your HCL Commerce Version 9 development environment.
Next, configure your imported store project for HCL Commerce Version 9.0.
The store migration process involves exporting the following assets as archive files, and then
importing the archive files:
- Custom static store assets
- Custom Java code
- Custom JSP files
Stores that are migrated from
IBM Websphere Commerce Version 7 or
IBM Websphere Commerce Version 8
to
HCL Commerce Version 9.0, are deployed to the
Transaction server, where
they serve live traffic. Stores that are created on
HCL Commerce Version 9.0
follow the new programming model and are deployed to a separate
Store server. For more information about migrating or creating a store
on
HCL Commerce Version 9.0, see:
Procedure
-
Export the Stores dynamic web project from your IBM Websphere Commerce Version 8 development
environment workspace.
-
Open your IBM Websphere Commerce Version 8 development environment workspace and open the J2EE
perspective.
-
From the Enterprise Explorer view, right-click the Stores project, then
click .
The Export window
appears.
- Expand the General folder, then click
.
- Under the Stores directory, select the following
subdirectories.
- Define a path where the archive file is to be exported.
For example,
c:\stores.zip.
- Under Options, ensure that he following export options are
defined.
- Save in zip format
- Compress the contents of the file
- Create only selected directories
-
Click Finish.
A
Stores.zip file is created and is ready to be imported into your
HCL Commerce Version 9.0 development
environment.
Important: Create a backup of this archive,
as you will need some of the configuration files in the Struts 2
migration later on.
- Optional:
If your IBM Websphere Commerce Version 8 development environment is on a
separate system from your HCL Commerce Version 9.0 development, copy the exported
Stores.zip file to your HCL Commerce Version 9.0 development environment.
-
Import your custom project.
-
Open your HCL Commerce Version 9 development environment workspace,
and then open the Java EE perspective.
-
From the Enterprise Explorer view, right-click the
Stores project, then click .
The Import window appears.
-
Expand the General folder, then click .
-
Click Browse, then select the
Stores.zip file that you exported from your
IBM Websphere Commerce Version 8 development environment.
-
In the compressed Stores file, select the
following subdirectories.
-
Define the Into folder field as your local
Stores directory.
-
Click the Overwrite existing resources without
warning check box.
-
Click Finish.
-
In HCL Commerce Version 9.0, all services use HTTPS. The stores
project that you imported into HCL Commerce Version 9.0 might still use
HTTP values. Review the following files, and change any
value="http:
code to value="https:
.
Note: Skip any files in the list that do not exist in your
environment.
- /Stores/WebContent/SitemapIndex.jsp
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/Common/EnvironmentSetup.jspf
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/EmailTemplates/Common/eMarketingSpotDisplay.jsp
- /Stores/WebContent/AuroraStorefrontAssetStore/Common/EnvironmentSetup.jspf
- /Stores/WebContent/AuroraStorefrontAssetStore/EmailTemplates/Common/eMarketingSpotDisplay.jsp
- /Stores/WebContent/Widgets_701/Common/EnvironmentSetup.jspf
- /Stores/WebContent/Widgets_801/Common/EnvironmentSetup.jspf
-
Correct the migrated password reset e-mail template
(PasswordResetNotify.jsp).
- Open the following files with a text editor.
- /WebContent/AuroraStorefrontAssetStore/EmailTemplates/User/PasswordResetNotify.jsp
- /WebContent/AuroraB2BStorefrontAssetStore/EmailTemplates/User/PasswordResetNotify.jsp
- Remove all instances of the following tag:
<%out.flush()%>
.
- Save and close the files.
Note: Failure to correct this template results in no
password reset email being generated and sent. Instead, the following error
is observed in
logs.
javax.persistence.TransactionRequiredException: No active transaction for PuId=ts#Enablement-BaseComponentsData.jar#WC
- Convert number values to string values by using the
fn:trim ()
function
within your <c:if test>
JSP tags.
Base classes within the JSP tag library differ between IBM Websphere Commerce Version 8 and HCL Commerce Version 9.0. If your IBM Websphere Commerce Version 8
JSP files use the <c:if test>
tag to evaluate
expressions, you must update those JSP files in HCL Commerce Version 9.0 to use the fn:trim ()
function. In some of your JSP files, you might compare a string to a number.
The underlying HCL Commerce Version 9.0 logic tries to convert
the string to a number before it compares them. If there are non-numeric
characters in the string, a conversion error is reported. The
fn:trim ()
function forcibly converts strings to
numbers before they are compared by HCL Commerce Version 9.0 logic.
The following code example shows
<c:if test>
tag without the
fn:trim
()
function within the
/Stores/WebContent/AuroraStorefrontAssetStore/Container/SubCategoryPageContainerWithTabs.jsp
file:
<c:if test="${childWidget.slot.internalSlotId == slotNumber && !foundCurrentSlot}">
The following code example shows
<c:if test>
tag with the
fn:trim
()
function added within the
/Stores/WebContent/AuroraStorefrontAssetStore/Container/SubCategoryPageContainerWithTabs.jsp
file:
<c:if test="${childWidget.slot.internalSlotId == fn:trim(slotNumber) && !foundCurrentSlot}">
Note: Notice
how the fn:trim ()
function is applied to slotNumber
value.
-
From your HCL Commerce Version 9.0 development
environment, open the following Search result page
JSP files.
- /Stores/WebContent/AuroraStorefrontAssetStore/Container/SubCategoryPageContainerWithTabs.jsp
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/Container/SubCategoryPageContainerWithTabs.jsp
- Locate the following line of code in each file.
- Update the lines of code by adding the
fn:trim ()
function to the
slotNumber
values, as illustrated in the following code example.
- Save and close the files.
- Open the following Product detail page JSP files.
- /Stores/WebContent/AuroraStorefrontAssetStore/Container/ProductPageContainer.jsp
- /Stores/WebContent/AuroraStorefrontAssetStore/Container/ProductPageContainerFullWidth.jsp
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/Container/ProductPageContainer.jsp
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/Container/ProductPageContainerFullWidth.jsp
- Locate the following line of code in each file.
- Update the lines of code by adding the
fn:trim ()
function to the
slotNumber
values, as illustrated in the following code example.
- Save and close the files.
- Open the following Register page JSP file.
- /Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.AddressForm/AddressForm_UI.jspf
- /Stores/WebContent/Widgets_801/com.ibm.commerce.store.widgets.AddressForm/AddressForm_UI.jspf
- /Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.OrganizationUserInfo/UserInfoUI/UserDetailsForm_UI.jspf
- /Stores/WebContent/Widgets_801/com.ibm.commerce.store.widgets.OrganizationUserInfo/UserInfoUI/UserDetailsForm_UI.jspf
- /Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.OrganizationUserInfo/UserInfoUI/UserDetailsDisplay_Data.jspf
- /Stores/WebContent/Widgets_801/com.ibm.commerce.store.widgets.OrganizationUserInfo/UserInfoUI/UserDetailsDisplay_Data.jspf
- Locate the following line of code.
- Update the line of code by adding the
fn:trim ()
function to the
preferredLanguage
value, as illustrated in the following code example.
- Save and close the file.
- Update your JSTLEnvironmentSetupExtForRemoteWidgets.jspf
files.
- Open the following files:
- \Stores\WebContent\AuroraB2BStorefrontAssetStore\Common\JSTLEnvironmentSetupExtForRemoteWidgets.jspf
- \Stores\WebContent\AuroraStorefrontAssetStore\Common\JSTLEnvironmentSetupExtForRemoteWidgets.jspf
- \Stores\WebContent\Widgets_701\Common\JSTLEnvironmentSetupExtForRemoteWidgets.jspf
- \Stores\WebContent\Widgets_801\Common\JSTLEnvironmentSetupExtForRemoteWidgets.jspf
- Remove the following block of code:
<c:when test="${!empty restNonSSLPort}">
<c:set var="restURLPort" value="${restNonSSLPort}" scope="request"/>
<c:set var="restURLScheme" value="http" scope="request"/>
</c:when>
- Save and close the files that you updated.
-
Remove the remote store configuration from your foundation
wc-component.xml file.
-
Open the following file for editing.
- workspace_dir/WC/xml/config/com.ibm.commerce.foundation/wc-component.xml
-
Locate and remove the
configgrouping
named
RemoteStoreConfiguration.
For example, remove the following code block:
<_config:configgrouping name="RemoteStoreConfiguration">
<!-- value to remote store web host name -->
<_config:property name="wc.store.remote.webHostName" value="store"/>
<!-- value to remote store web host HTTP port number -->
<_config:property name="wc.store.remote.webNonSSLPort" value="8080"/>
<!-- value to remote store web host HTTPS port number -->
<_config:property name="wc.store.remote.webSSLPort" value="8443"/>
<!-- value to remote store context root -->
<_config:property name="wc.store.remote.webContextPath" value="/shop"/>
<!-- value to remote store preview context root -->
<_config:property name="wc.store.remote.previewContextPath" value="/webapp/remote/preview/servlet"/>
<!-- value to kafka servers connection string -->
<_config:property name="wc.store.remote.kafka" value=""/>
<!-- value to kafka servers topic prefix -->
<_config:property name="wc.store.remote.kafka.topicPrefix" value="sampleprefix"/>
<!-- value to remote store web alias -->
<_config:property name="wc.store.remote.webAlias" value="/wcsstore"/>
<!-- value to remote store app host name (used for invoking email JSPs in remote store) -->
<_config:property name="wc.store.remote.appHostName" value="localhost"/>
<!-- value to remote store app host HTTPS port number (used for invoking email JSPs in remote store) -->
<_config:property name="wc.store.remote.appSSLPort" value="8443"/>
</_config:configgrouping>
-
Save and close the file.
Warning: This change will need to be
done again after upgrading the development environment to a higher
fix pack, because that procedure will overwrite the
wc-component.xml file. The newly changed
file will then need to be deployed to the upgraded production
environment.
If you are migrating to HCL Commerce Version 9.0.1+, you must upgrade
your Struts configuration. See Migrating customized IBM Websphere Commerce Version 7 Feature Pack 6 web applications to Struts 2. In
addition, if you have any existing customizations to the web.xml customization
file, you must manually upgrade this to conform to the Struts 2 standard. See
Struts 2 configuration file changes.
-
If you are migrating to the base level of HCL Commerce Version 9.0, copy the
following file from your IBM Websphere Commerce Version 8 development environment to
your HCL Commerce Version 9.0 development environment. If you are migrating to
version 9.0.0.1 or higher, you can skip this step.
- WCDE_installdir\workspace\Rest\WebContent\atom\site-default\FeedEnvironment.jspf
-
This step is only required if you are migrating
from WebSphere Commerce 8.0.4.27 or earlier.
-
Open
Stores\WebContent\Widgets_701\Common\CatalogEntry\CatalogEntryDisplay_MiniListView_UI.jspf
-
Find and delete the following lines of code:
<c:if test="${aStatus.first}">
<c:set var="firstSwatchName" value="${swatchName}" />
</c:if>
-
Locate the following line of code:
<c:forEach var="swatchValue" items="${swatchValues}" varStatus="vStatus">
<c:set var="index" value="${fn:trim(vStatus.count-1)}" />
-
Add the following line of code after the above code:
<c:set var="firstSwatchName" value="${swatchName}" />
-
Open the following files for editing.
- \Stores\WebContent\AuroraStorefrontAssetStore\javascript\Common\ShoppingActions.js
- \Stores\WebContent\AuroraB2BStorefrontAssetStore\javascript\Common\ShoppingActions.js
-
Locate the following lines of code:
for(attribute in entitledItem.Attributes){
var currentSwatch = attribute.substring(0, attribute.lastIndexOf("_|_"));
if(currentSwatch != doNotDisable && currentSwatch != swatchName){
-
Replace the above lines with the following lines of code:
for(attribute in entitledItem.Attributes){
var currentSwatch = attribute.substring(0, attribute.lastIndexOf("_|_"));
if(currentSwatch == doNotDisable && currentSwatch != swatchName){
-
Save and close all files.
-
Make the following change to ensure categories appear as expected after logging
into the storefront.
-
Open the following file for editing.
- WCDE_installdir\workspace\Stores\WebContent/store_name\Common\CommonJSToInclude.jspf
Where
- store_name
- The base name of the directory in which store-specific
Web assets, such as JSP files and property files, are
found. For example,
AuroraStorefrontAssetStore
.
-
Locate
<link rel="apple-touch-icon-precomposed"
href="${jspStoreImgDir}images/touch-icon-152px.png"
sizes="152x152"/>
in the file, then append the following
script.
<script type="text/javascript">
//Redirect to HTTPS request in the browser when detect that using HTTP request,
//since HTTP request is no longer supported in v9.
var httpsProtocol = "https:";
var securedPort = '<c:out value="${configValueMap[\'WebServer/SSLPort\']}"/>';
if (window.location.protocol != httpsProtocol){
var href = httpsProtocol + window.location.href.substring(window.location.protocol.length);
var host = window.location.host;
var hostname = window.location.hostname;
var httpsHost = httpsHost = (securedPort != "" && securedPort != null) ? hostname + ":" + securedPort : hostname;
href = href.replace(host, httpsHost);
window.location.href = href;
}
</script>
-
Save and close the file.
- Update your STORECONF table with your extended sites store
IDs.
- Open a command prompt to your version 9 development database.
- Run the following SQL command to retrieve the store IDs for your specific type of
store:
select store_id from store where directory in ('store_name');
Where
- store_name
- The base name of your store, for example,
AuroraESite
.
- For each extended site store ID retrieved, insert a corresponding record into your
STORECONF table by running the following command:
Insert into storeconf values(STOREENT_ID, 'wc.store.isRemote','0',0);
Where:
- STOREENT_ID
- The ID of the store that you retrieved from the previous SQL command.
- Remove the EJB from the store preview header.
-
Open the
\Stores\WebContent\tools\preview\StorePreviewerHeader.jsp
file for editing.
- Locate the following snippet.
pageContext.setAttribute("workspaceId", abWorkspace.getWorkspaceIdInEJBType().toString());
- Replace the snippet with the following.
pageContext.setAttribute("workspaceId", abWorkspace.getWorkspaceId().toString());
-
Save and close the file.
-
Update address-related JSPs to correctly display the shipping and billing
address on the checkout page.
-
Open the following files for editing.
- Stores\WebContent\AuroraB2BStorefrontAssetStore\ShoppingArea\CheckoutSection\SingleShipment\ShippingAddressSelect.jsp
- Stores\WebContent\AuroraStorefrontAssetStore\ShoppingArea\CheckoutSection\SingleShipment\ShippingAddressSelect.jsp
-
Locate the following code snippet.
<c:set var="selectedAddressId" value="${param.addressId}"/>
-
Replace it with the following code snippet.
<c:set var="selectedAddressId" value="${orderShipInfo.usableShippingAddress[0].addressId}"/>
-
Save and close the files.
-
Open the following files for editing.
- Stores\WebContent\AuroraStorefrontAssetStore\Snippets\Member\Address\AddressDisplay.jsp
- Stores\WebContent\AuroraB2BStorefrontAssetStore\Snippets\Member\Address\AddressDisplay.jsp
-
Locate the following code snippet.
<c:if test="${empty WCParam.addressId}" >
-
Replace it with the following code snippet.
<c:if test="${empty WCParam.addressId || WCParam.addressId ne param.addressId }" >
-
Save and close the files.
-
Update Content_UI.jspf to correctly display the icon that
symbolizes URL attachments for marketing content.
-
Open the following files for editing.
- \Stores\WebContent\Widgets_701\com.ibm.commerce.store.widgets.ContentRecommendation\Content_UI.jspf
- \Stores\WebContent\Widgets_801\com.ibm.commerce.store.widgets.ContentRecommendation\Content_UI.jspf
-
Locate the following code snippet.
<c:if test="${not empty fileType}">
-
Below this snippet, add the following code.
<c:if test="${fileType eq 'html' || fileType eq 'htm' || mimeType eq 'text/html'}">
<c:set var="attachmentType" value="html"/>
</c:if>
-
Save and close the files.
-
Update the JSP files related to the Price filter that are used for generating
URLs.
-
Open the
Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.CatalogEntryList/CatalogEntryList_UI.jspf
file for editing.
-
Open the
Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.CatalogEntryList/javascript/SearchBasedNavigationDisplay.js
file for editing.
- Locate the following line of code.
checkPriceInput:function(event)
- Replace the line with the following.
checkPriceInput:function(event, currencySymbol)
- Locate the following line of code.
this.appendFilterPriceRange();
- Replace the line with the following.
this.appendFilterPriceRange(currencySymbol);
- Locate the following line of code.
appendFilterPriceRange:function()
- Replace the line with the following.
appendFilterPriceRange:function(currencySymbol)
- Locate the following line of code.
var label = this.currencySymbol + byId("low_price_input").value + " - " + this.currencySymbol + byId("high_price_input").value;
- Replace the line with the following.
var label = currencySymbol + byId("low_price_input").value + " - " + currencySymbol + byId("high_price_input").value;
- Locate the following line of code.
restoreHistoryContext:function()
- Replace the line with the following.
restoreHistoryContext:function(currencySymbol)
- Locate the following line of code.
this.appendFilterPriceRange();
- Replace the line with the following.
this.appendFilterPriceRange(currencySymbol);
-
Open the
Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.FacetNavigation/FacetNavigation_HorizontalView_UI.jspf
file for editing.
- Locate the following line of code.
<input id="low_price_input" role="textbox" aria-label="<fmt:message key="LN_SEARCH_FACET_LOWER_BOUND" bundle="${widgetText}"/>" onkeyup="SearchBasedNavigationDisplayJS.checkPriceInput(event);" class="range_input" type="tel"/>
- Replace the line with the following.
<input id="low_price_input" role="textbox" aria-label="<fmt:message key="LN_SEARCH_FACET_LOWER_BOUND" bundle="${widgetText}"/>" onkeyup="SearchBasedNavigationDisplayJS.checkPriceInput(event, '<c:out value='${env_CurrencySymbolToFormat}' escapeXml='false'/>');" class="range_input" type="tel"/>
- Locate the following line of code.
<input id="high_price_input" role="textbox" aria-label="<fmt:message key="LN_SEARCH_FACET_UPPER_BOUND" bundle="${widgetText}"/>" onkeyup="SearchBasedNavigationDisplayJS.checkPriceInput(event);" class="range_input" type="tel"/>
- Replace the line with the following.
<input id="high_price_input" role="textbox" aria-label="<fmt:message key="LN_SEARCH_FACET_UPPER_BOUND" bundle="${widgetText}"/>" onkeyup="SearchBasedNavigationDisplayJS.checkPriceInput(event, '<c:out value='${env_CurrencySymbolToFormat}' escapeXml='false'/>');" class="range_input" type="tel"/>
- Locate the following line of code.
setTimeout("SearchBasedNavigationDisplayJS.restoreHistoryContext();", 200);
- Replace the line with the following.
setTimeout("SearchBasedNavigationDisplayJS.restoreHistoryContext(\"<c:out value='${env_CurrencySymbolToFormat}' escapeXml='false'/>\");", 200);
-
Open the
Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.FacetNavigation/FacetNavigation_VerticalView_UI.jspf
file for editing.
- Locate the following line of code.
<input id="low_price_input" role="textbox" aria-label="<fmt:message key="LN_SEARCH_FACET_LOWER_BOUND" bundle="${widgetText}"/>" onkeyup="SearchBasedNavigationDisplayJS.checkPriceInput(event);" class="range_input" type="tel"/>
- Replace the line with the following.
<input id="low_price_input" role="textbox" aria-label="<fmt:message key="LN_SEARCH_FACET_LOWER_BOUND" bundle="${widgetText}"/>" onkeyup="SearchBasedNavigationDisplayJS.checkPriceInput(event, '<c:out value='${env_CurrencySymbolToFormat}' escapeXml='false'/>');" class="range_input" type="tel"/>
- Locate the following line of code.
<input id="high_price_input" role="textbox" aria-label="<fmt:message key="LN_SEARCH_FACET_UPPER_BOUND" bundle="${widgetText}"/>" onkeyup="SearchBasedNavigationDisplayJS.checkPriceInput(event);" class="range_input" type="tel"/>
- Replace the line with the following.
<input id="high_price_input" role="textbox" aria-label="<fmt:message key="LN_SEARCH_FACET_UPPER_BOUND" bundle="${widgetText}"/>" onkeyup="SearchBasedNavigationDisplayJS.checkPriceInput(event, '<c:out value='${env_CurrencySymbolToFormat}' escapeXml='false'/>');" class="range_input" type="tel"/>
- Locate the following line of code.
setTimeout("SearchBasedNavigationDisplayJS.restoreHistoryContext();", 200);
- Replace the line with the following.
setTimeout("SearchBasedNavigationDisplayJS.restoreHistoryContext(\"<c:out value='${env_CurrencySymbolToFormat}' escapeXml='false'/>\");", 200);
-
Save and close the files.
Results
Your Aurora-based store is successfully migrated.