What is reported in this article is the result of what we have done for a real migration.
Assumptions
- Best case: WCS on version 7 FEP8 or version 8
- If you are on version 7 <FEP8, the suggestion is to migrate to FEP8 and than to version 9
- You don't need to migrate also EJBs and Transactional server customizations: good news is, they can work as they are (but, to take some of the advantages of the version 9, you should think about their migration to JPA and xC).
The migration plan
In a nutshell, the plan is the following (development oriented):
- Migrate the security easy - well documented
- Migrate the configuration files medium - it can create doubts about the proper way to do it
- Migrate the Store web project medium - it is error prone task since manual changes are needed
- Migrate Management Center complex - for the same nature of CMC
- Migrate the Physical Service Data Object easy - well documented
- Migrate the Extension Logic and custom projects easy - well documented
- (Optional) Migrate to xC and JPA complex - for the impact and the same customization complexity
For an average WCS platform (+7 FEP8) the migration of the toolkit (and so the code) can be considered a few weeks task.
Below we provide details of specific subtask which are not so evident in the Knowledge Center. In particular our attention will be focused on "Migrate the Store web project" and "Migrate Management Center".
Migrate the Store web project
All services use HTTPS
<FrontEndAssetStore>/Common/EnvironmentSetup.jspf
must use just
value="https:
instead of
value="http:
Use fn:trim () function within the <c:if test> JSP tags
The V9 logic tries to convert the string to a number before it compares them. The fn:trim () function converts strings to numbers before they are compared.
<FrontEndAssetStore>/Container/SubCategoryPageContainerWithTabs.jsp <FrontEndAssetStore>/Container/ProductPageContainer.jsp Widgets_701/com.ibm.commerce.store.widgets.AddressForm/AddressForm_UI.jspf Widgets_801/com.ibm.commerce.store.widgets.AddressForm/AddressForm_UI.jspf Widgets_701/com.ibm.commerce.store.widgets.OrganizationUserInfo/UserInfoUI/UserDetailsForm_UI.jspf Widgets_801/com.ibm.commerce.store.widgets.OrganizationUserInfo/UserInfoUI/UserDetailsForm_UI.jspf
must use
fn:trim()
Example:
<c:if test="${childWidget.slot.internalSlotId == fn:trim(slotNumber) && !foundCurrentSlot}">
instead of
<c:if test="${childWidget.slot.internalSlotId == slotNumber && !foundCurrentSlot}">
Update the CommonJSToInclude.jspf with additional java script
<FrontEndAssetStore>/Common/CommonJSToInclude.jspf
must have the following code
<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>
appended just after
<link rel="apple-touch-icon-precomposed" href="${jspStoreImgDir}images/touch-icon-152px.png" sizes="152x152"/>
Migrate struts
Struts need to be migrated to the version 2. Despite an automatic tool is providedhttps://www.ibm.com/support/knowledgecenter/fr/SSZLC2_9.0.0/com.ibm.commerce.migrate.doc/code/strutsmigration.jar?view=kc), this task needs also manual changes like adding the following code to the migrated version of struts-wcs-stores-marketing-services.xml
<action class="com.ibm.commerce.struts.v2.BaseAction" name="CustomerSegmentUBXIntegrate"> <param name="authenticate">0:0</param> <param name="https">0:1</param> <param name="parameter">com.ibm.commerce.marketing.segment.commands.CustomerSegmentUBXIntegrateCmd</param> </action> <action class="com.ibm.commerce.struts.v2.BaseAction" name="ScheduledCustomerSegmentImport"> <param name="authenticate">0:0</param> <param name="https">0:1</param> <param name="parameter">com.ibm.commerce.marketing.segment.commands.ScheduledCustomerSegmentImportCmd</param> </action>
Migrate the Management Center
The migration of CMC is pretty straight. In fact, it did not change at all on version 9. However, for the same nature of CMC the troubleshooting can be really hard and time consuming.
Coding suggestions to keep into account
Migrate the Management Center
The migration of CMC is pretty straight. In fact, it did not change at all on version 9. However, for the same nature of CMC the troubleshooting can be really hard and time consuming.
V8 | v9 |
---|---|
com.ibm.commerce.base.objects.ServerJDBCHelperAccessBean | Remove any use of this class |
ServerJDBCHelperAccessBean jdbcAccessBean = new ServerJDBCHelperAccessBean(); results = jdbcAccessBean.executeQuery(query); | To execute SQL queries, remove this piece of code and use the next instruction instead:results = SessionBeanHelper.lookupSessionBean(ServerJDBCHelperBean.class). executeQuery(query); |
ServerJDBCHelperAccessBean jdbcAccessBean = new ServerJDBCHelperAccessBean(); jdbcAccessBean.executeUpdate(queryValue); | To execute update queries, remove this piece of code and use the next instruction insteadSessionBeanHelper.lookupSessionBean(ServerJDBCHelperBean.class). executeUpdate(queryValue); |
ServerJDBCHelperAccessBean sjdbcHelperAB = new ServerJDBCHelperAccessBean(); records = sjdbcHelperAB.executeParameterizedQueryNoCache( MERCHCONFINFO_ALL, new Object[]{ "recurringMerchantCode" } ); | To execute executeParameterizedQueryNoCache method, remove this piece of code and use the next instruction instead:SessionBeanHelper.lookupSessionBean(ServerJDBCHelperBean.class). executeParameterizedQueryNoCache( MERCHCONFINFO_ALL, new Object[]{ "recurringMerchantCode" } ); |
results = jdbcAccessBean.executeParameterizedQuery (queryValue, parameters); | To execute executeParameterizedQuery method, remove this piece of code and use the next instruction insteadresults = SessionBeanHelper.lookupSessionBean(ServerJDBCHelperBean.class). executeParameterizedQuery(queryValue, parameters ); |
commitCopyHelper() | remove refreshCopyHelper from the code, no need to explicitly use EntityManager to make the changed JPA entity persistent. Once the transaction commit or flush operation is called, the changed data will be committed to the database. (see the reference). |
refreshCopyHelper | remove refreshCopyHelper from the code |
InEJBType() | replace any occurrence of String “InEJBType()” by “InEntityType()” (updating all AccessBeans getters suffix) |
Enumeration sds = ShippingModeCache.findByStoreEntity( getCommandContext().getStoreId()); | ShippingModeAccessBean has been extended to take advantage of the WebSphere Commerce data cache. Therefore use the following codeEnumeration sds = new ShippingModeAccessBean().findByStoreEntity( getCommandContext().getStoreId()); |
addSitemaps method of the com.ibm.commerce.seo.commands.SitemapGenerateCmdImpl implementation | SitemapGenerateCmdImpl.addSitemaps method has been renamed to zipSiteMapFiles. |
Do not get stuck on older versions, migrate to version 9
We can help you out to lead the migration, create the new infrastructure, design the proper strategy, plan the cutover, execute it!
Do not hesitate to contact us here.

CEO at Orienteed.