Migrating the WebSphere Commerce Version 8 Aurora store web project
To migrate the WebSphere Commerce Version 8 store to WebSphere Commerce Version 9, export your Stores project from the WebSphere Commerce Version 8, then import the project into the WebSphere Commerce Version 9 development environment. Next, configure your imported store project for WebSphere Commerce Version 9. 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 the WebSphere Commerce Version 8 development environment workspace.
- Open the WebSphere Commerce Version 8 development environment workspace and 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, select the following subdirectories.
- WebContent
- src
- Define a path where the archive file is to be exported.
- 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 the WebSphere Commerce Version 9 development environment.
- Optional: If the WebSphere Commerce Version 8 development environment is on a separate system from the WebSphere Commerce Version 9 development, copy the exported Stores.zip file to the WebSphere Commerce Version 9 development environment.
- Importing our custom project.
- Open the WebSphere 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 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 the WebSphere Commerce Version 8 development environment.
- In the compressed Stores file, select the following subdirectories.
- WebContent
- src
- Define the Into folder field as your local Stores directory.
- Click the Overwrite existing resources without warning check box.
- Click Finish.
- 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 WebSphere Commerce Version 8 and WebSphere Commerce Version 9. If the WebSphere Commerce Version 8 JSP files use the <c:if test> tag to evaluate expressions, we must update those JSP files in WebSphere Commerce Version 9 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 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 WebSphere Commerce Version 9 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 the WebSphere Commerce Version 9 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 preferredLanguage 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 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
- 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.
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. In addition, if you have any existing customizations to the web.xml customization file, we must manually upgrade this to conform to the Struts 2 standard. See Struts 2 configuration file changes.
- Copy your struts-config-ext.xml file from the WebSphere Commerce Version 8 runtime environment to your WCB server.
- Go to the following directory on the WebSphere Commerce Version 8 runtime environment:
- WC_eardir\Stores.war\WebContent\WEB-INF\
- Copy the struts-config-ext.xml file to the following directory of the WebSphere Commerce Version 9 build server:
- WCB_installdir\source\Stores\WebContent\WEB-INF\
- If we are migrating to the base level of version 9.0, copy the following file from your version 8.0 development environment to your version 9.0 development environment. If we are migrating to version 9.0.0.1 or higher, we can skip this step.
- WCDE_installdir\workspace\Rest\WebContent\atom\site-default\FeedEnvironment.jspf
- Update your CommonJSToInclude.jspf with additional java script, otherwise your categories might not appear 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, AuroraESite.
- 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 CommonJSToInclude.jspf file.
- Copy the propertyViews files from under your LOBTools directory of the WebSphere Commerce Version 8 runtime environment to your WCB server.
- Go to the following directory on the WebSphere Commerce Version 8 runtime environment:
- WC_eardir\LOBTools\WebContent\WEB-INF\src\xml\commerce\store\propertyViews\
- Copy all of the files under that propertryViews directory to the following directory in the WebSphere Commerce Version 9 build server:
- WCB_installdir\source\LOBTools\WebContent\WEB-INF\src\xml\commerce\store\propertyViews\
- Copy all the flex flow properties files from the WebSphere Commerce Version 8 runtime environment to your WCB server.
- Go to the following directory on the WebSphere Commerce Version 8 runtime environment:
- WC_eardir\properties\tools\
- Copy all of the files under that tools directory to the following directory in the WebSphere Commerce Version 9 build server:
- WCB_installdir\source\WC\properties\
- 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 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.
Previous topic: Migrate the development database.
Next topic: Migrate our custom struts applications