Migrating the WebSphere Commerce Version 7 Feature Pack 8 Aurora store web project
To migrate your Feature Pack 8 store to WebSphere Commerce Version 9.0.0.1+, export your Stores project from your Feature Pack 8, then import the project into the WebSphere Commerce Version 9.0.0.1+ development environment. Next, configure your imported store project for WebSphere Commerce Version 9.0.0.1+. 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 version 7.0 or version 8.0 to version 9.0, are deployed to the WebSphere Commerce Version 9 Transaction server, where they serve live traffic. Stores that are created on version 9.0 follow the new programming model and are deployed to a separate Store server. For more information about creating a store on version 9.0, see Creating our custom store.
Before beginning
- Ensure that you open ports 80 and 443 on your Transaction web server, so your local store can serve traffic once it is deployed to The Transaction server.
Procedure
- Export the Stores dynamic web project from your Feature Pack 8 development environment workspace.
- Open your Feature Pack 8 development environment workspace, then open the J2EE perspective.
- From the Enterprise Explorer view, right-click the Stores project, then click Export > Export.... The Export window appears.
- Expand the General folder, then click Archive File > Next.
- Under the Stores directory, clear the Stores check box, and select the following subdirectories.
- WebContent
- src
- Ensure the Create only selected directories option is selected.
- Click Browse and define a path where the archive file is to be exported.
- Under Options, ensure that the following export option is defined.
- Create only selected directories
- Click Finish. A Stores.zip file is created and is ready to be imported into the WebSphere Commerce Version 9.0.0.1+ development environment.
- Copy the exported Stores.zip file to the WebSphere Commerce Version 9.0.0.1+ development environment.
- Importing our custom project.
- Open the WebSphere Commerce Version 9.0.0.1+ development environment workspace, and then open the Java EE perspective.
- From the Enterprise Explorer view, right-click the Stores project, then click Import > Import.... The Import window appears.
- Expand the General folder, then click Archive File > Next.
- Click Browse, then select the Stores.zip file that you exported from your Feature Pack 8 development environment.
- Click the Overwrite existing resources without warning check box.
- Click Finish.
- Manually copy all the directories and files in the following path from your Feature Pack 8 development environment to the same path on WebSphere Commerce Version 9.0.0.1+ development environment:
workspace_dir/WC/properties/tools/stores/store_dir/Where store_dir is the directory name for the store.
- Review the following files to ensure that the database configuration is correct. Edit each file if necessary.
- WCDE_installdir/workspace/WC/META-INF/ibmconfig/cells/defaultCell/applications/defaultApp/deployments/defaultApp/resources.xml
- Liberty_installdir/usr/servers/searchServer/configDropins/overrides/datasources.xml
- WCDE_installdir/workspace/WC/META-INF/ibmconfig/cells/defaultCell/security.xml
- Remove the nonexistent filter in your web.xml file.
- Open the following file for editing.
- WCDE_installdir/workspace/Stores/WebContent/WEB-INF/web.xml
- Remove the following block of code.
<filter> </icon> <filter-name>LikeMindsFilter</filter-name> <filter-class>com.ibm.commerce.likeminds.filter.LikeMindsFilter</filter-class> </filter> <filter-mapping> <filter-name>LikeMindsFilter</filter-name> <servlet-name>Stores Request Servlet</servlet-name> </filter-mapping>
- Save and close the file.
- 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
- Remove the following block of code.
<_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.
- Update your struts-config.xml file.
In WebSphere Commerce Version 9.0.0.1+, URLs based on HTTP protocol are no longed supported, which might cause some users to encounter problems where category pages fail to load after they log in to your store.
- Open the /Stores/WebContent/WEB-INF/struts-config.xml file for editing.
- Locate the following property.
<set-property property="https" value="0:0"/>
- Update the value from "0:0" to "0:1". Your updated code appears as follows.
<set-property property="https" value="0:1"/>
- Save and close the file.
- In WebSphere Commerce Version 9, all services use HTTPS. The stores project that you imported into WebSphere Commerce Version 9 might still use HTTP values. Review the following files, and change any value="http: code to value="https:.
Note: Skip any files that do not exist.
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/Common/EnvironmentSetup.jspf
- /Stores/WebContent/AuroraStorefrontAssetStore/Common/EnvironmentSetup.jspf
- /Stores/WebContent/Widgets_701/Common/EnvironmentSetup.jspf
- /Stores/WebContent/Widgets_801/Common/EnvironmentSetup.jspf
- Convert number values to string values using the fn:trim () function within your <c:if test> JSP tags.
Base classes within the JSP tag library differ between Feature Pack 8 and WebSphere Commerce Version 9.0.0.1+. If your Feature Pack 8 JSP files use the <c:if test> tag to evaluate expressions, we must update those JSP files in WebSphere Commerce Version 9.0.0.1+ to use the fn:trim () function. In some of your JSP files, we might compare a string to a number. The underlying WebSphere Commerce Version 9.0.0.1+ logic tries to convert the string to a number before comparing them. If there are non-numeric characters in the string, a conversation error is reported. The fn:trim () function forcibly converts strings to numbers before they are compared by WebSphere Commerce Version 9.0.0.1+ 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}">Notice how the fn:trim () function is applied to slotNumber value.
- From the WebSphere Commerce Version 9.0.0.1+ 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.
<c:if test="${childWidget.slot.internalSlotId == slotNumber && !foundCurrentSlot}">
- Update the lines of code by adding the fn:trim () function to the slotNumber values, as illustrated in the following code example.
<c:if test="${childWidget.slot.internalSlotId == fn:trim(slotNumber) && !foundCurrentSlot}">
- Save and close the files.
- Open the following Product detail page JSP files.
- /Stores/WebContent/AuroraStorefrontAssetStore/Container/ProductPageContainer.jsp
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/Container/ProductPageContainer.jsp
- Locate the following line of code in each file.
<c:if test="${childWidget.slot.internalSlotId == slotNumber && !foundCurrentSlot}">
- Update the lines of code by adding the fn:trim () function to the slotNumber values, as illustrated in the following code example.
<c:if test="${childWidget.slot.internalSlotId == fn:trim(slotNumber) && !foundCurrentSlot}">
- 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
- Locate the following line of code.
<c:if test="${language.localeName == preferredLanguage || language.languageId == preferredLanguage }">
- Update the line of code by adding the fn:trim () function to the slotNumber value, as illustrated in the following code example.
<c:if test="${language.localeName == fn:trim(preferredLanguage) || language.languageId == preferredLanguage }">
- Save and close the file.
- Update the definitions associated with EJB in your GlobalLoginOrganizationAndContract_UI.jspf file.
- Open the following file for editing.
- /Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.GlobalLogin/GlobalLoginOrganizationAndContract_UI.jspf
- Replace all instances of organizationIdInEJBType with organizationId.
- Save and close the file.
- Feature Pack 8 and WebSphere Commerce Version 9.0.0.1+ differ in the way they generate and analyze SKU lists in JSON data. To account for this difference, we must update specific JSP and JSPF files.
- Open the following files for editing.
- /Stores/WebContent/AuroraStorefrontAssetStore/ShoppingArea/CatalogSection/CatalogEntrySubsection/ProductDisplay.jsp
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/ShoppingArea/CatalogSection/CatalogEntrySubsection/ProductDisplay.jsp
- /Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.PDP_DefiningAttributes/DefiningAttributes_Data.jspf
- /Stores/WebContent/AuroraStorefrontAssetStore/Widgets/CompareProduct/CompareProduct_UI.jspf
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/Widgets/CompareProduct/CompareProduct_UI.jspf
- In each file, locate the following lines.
<c:set var="replaceStr" value='\\\\"'/> <c:set var="replaceStr01" value="\\\\'"/>
- Update the value from value='\\\\"' to value='\\"'. The following example shows how the code looks after your update.
<c:set var="replaceStr" value='\\"'/> <c:set var="replaceStr01" value="\\'"/>
- Save and close the files.
- Update your RegistrationUpdateCommonPage.jsp file to resolve a potential WebSphere Commerce Version 9.0.0.1+ parsing error that occurs when the Personal information page loads.
- Open the following files for editing.
- /Stores/WebContent/AuroraStorefrontAssetStore/UserArea/AccountSection/RegistrationSubsection/RegistrationUpdateCommonPage.jsp
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/UserArea/AccountSection/RegistrationSubsection/RegistrationUpdateCommonPage.jsp
- Around line 40, add the following block of code to the variable section.
<c:set var="personSession" value="${requestScope.personSession}"/> <c:if test="${empty personSession || personSession==null}"> <wcf:rest var="personSession" url="store/{storeId}/person/{personId}" scope="request"> <wcf:var name="storeId" value="${WCParam.storeId}" encode="true"/> <wcf:var name="personId" value="${userId}" encode="true"/> </wcf:rest> </c:if>
- Around line 120, locate the following line of code.
<fmt:param><fmt:formatDate type="both" dateStyle="long" value="${CommandContext.user.lastSessionInEJBType}"/></fmt:param
- Update the line of code with the following.
<fmt:param><c:out value="${personSession.lastSession}"/></fmt:param>
- Save and close the files.
- Update specific JS and CSS files to account for errors when a user cancels recurring and subscriptions orders.
- Open the following files for editing.
- /Stores/WebContent/AuroraStorefrontAssetStore/javascript/UserArea/MyAccountDisplay.js
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/javascript/UserArea/MyAccountDisplay.js
- Around line 719, add the following line of code.
params["orderId"] = "null";The following example shows how the code looks after your update.
/*For Handling multiple clicks. */ if(!submitRequest()){ return; } cursor_wait(); var params = []; params["orderId"] = "null"; params["subscriptionId"] = subscriptionId; params["URL"] = ""; params["storeId"] = MyAccountServicesDeclarationJS.storeId; params["catalogId"] = MyAccountServicesDeclarationJS.catalogId; params["langId"] = MyAccountServicesDeclarationJS.langId; wc.service.invoke("AjaxCancelSubscription", params);
- Save and close the files.
- Open the following files for editing.
- /Stores/WebContent/AuroraStorefrontAssetStore/css/legacy1_1.css
- /Stores/WebContent/AuroraStorefrontAssetStore/css/legacy1_1_rtl.css
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/css/legacy1_1.css
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/css/legacy1_1_rtl.css
- Around line 3750, locate the following line of code.
background-image: url('../images/colors/color1/popup_center_tile_sm.png');
- Change the code to the following.
background-image: url('../images/colors/color1/popup_center_tile_mini.png');
- Save and close the files.
- Update your JSPF files so users can click the subscribe link on your storefront.
- Open the following files for editing.
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/Common/JSTLEnvironmentSetupExtForRemoteWidgets.jspf
- /Stores/WebContent/AuroraStorefrontAssetStore/Common/JSTLEnvironmentSetupExtForRemoteWidgets.jspf
- /Stores/WebContent/Widgets_701/Common/JSTLEnvironmentSetupExtForRemoteWidgets.jspf
- In each of the files, locate and remove the following 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.
- Update your payments and billing JSPF files to handle the Apple Pay payment method.
- Open the following files for editing.
- /Stores/WebContent/AuroraStorefrontAssetStore/ShoppingArea/CheckoutSection/CheckoutPaymentsAndBillingAddress.jspf
- /Stores/WebContent/AuroraB2BStorefrontAssetStore/ShoppingArea/CheckoutSection/CheckoutPaymentsAndBillingAddress.jspf
- Around line 500, locate the following code.
<c:if test="${currentPaymentMethodName != 'PayInStore' && currentPaymentMethodName != 'CompatiblePayment' && (currentPaymentMethodName ne 'SimplePunchout' or (currentPaymentMethodName eq 'SimplePunchout' and punchoutPaymentAllowed))}">
- Update the code by adding currentPaymentMethodName != 'ApplePay' method. The following example shows how the code looks after your update.
<c:if test="${currentPaymentMethodName != 'ApplePay' && currentPaymentMethodName != 'PayInStore' && currentPaymentMethodName != 'CompatiblePayment' && (currentPaymentMethodName ne 'SimplePunchout' or (currentPaymentMethodName eq 'SimplePunchout' and punchoutPaymentAllowed))}">
- Save and close the files.
- Update your STORECONF table with your extended sites store IDs.
- Open a command prompt to the WebSphere Commerce Version 9.0.0.1+ development database.
- Run the following SQL command to retrieve the store IDs for our specific type of store:
select store_id from store where directory in ('store_name');Where
- store_name
- The base name of the store, for example, AuroraESite.
- For each extended site store ID retrieved, insert a corresponding record into your STORECONF table.
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.
If we are migrating to WebSphere Commerce Version 9.0.1+, we will need to upgrade your Struts configuration. See Migrating customized web applications to Struts 2.
Previous topic: Migrate the development database.
Next topic: Migrate our custom struts applications