Tag: Sitecore 8.2

SITECORE UPGRADE FROM 8.2 V TO 10.2 V NUTS AND BOLTS

Recently I have started the Sitecore upgrade of 8.2 v to 10.2 one of our client which having the multisite solution. Sitecore has provided the very comprehensive guide and direct upgrade path of Sitecore 8.2 to Sitecore 10.2. Best part is we can directly upgrade Sitecore 8.2 instance to Sitecore 10.2 version.

Apart from following the Sitecore upgrade path we have to consider the following key area’s before the upgrade start.

  1. Pipeline Customization
  2. WFFM form
  3. xDb API
  4. Search
  5. Glass mapper
  6. Sitecore deprecated class post 8.2 version
  7. Sitecore modules customization.
  8. Sitecore Client customization

Following approach we have taken to upgrade the Sitecore 8.2 to 10.2 version:

  • Upgrade  .net framework to 4.8 for all projects in Solution.
  • Upgraded the DLL.s nugget package (Verify the Sitecore DLL’s version from Sitecore Assembly list provided on below link  under section  “Release informationhttps://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/102/Sitecore_Experience_Platform_102.aspx
  • Disable all the patch files.
  • Resolve the Compilation error
  • Install Sitecore 10.2 vanilla instance.
  • Upgrade the Master,Web and core databases ( If there on customization not done in Core DB then in this case use Core database installed at the time of step 4)
  • Connect upgraded database to Sitecore 10.2 Vanilla instance.
  • Deploy the upgraded code to new Sitecore 10.2 instance.
  • Test the application and resolve the run time error
  • Enable one by one patch files.

During upgrade we  have found some issues and below are the issues with the solution.

Depreciated Code in Sitecore 10.2:

Issue 1:  Sitecore.Eventing.EventManager.QueueEvent

Solution: We have to use instead of above code the following class:    Sitecore.Eventing.EventQueue.QueueEvent 

Issue 2: In Sitecore 8.2 to get the Device information we use below code but it is depreciated in Sitecore 10 version.

    Sitecore.CES.DeviceDetection. GetDeviceInformation(useragent);

Solution : In Sitecore 10.2 instead of above code use the below code

using Sitecore.CES.DeviceDetection;
using Sitecore.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

DeviceDetectionManagerBase deviceDetectionManager = ServiceLocator.ServiceProvider.GetRequiredService<DeviceDetectionManagerBase>();
if (deviceDetectionManager.IsEnabled)
{

var deviceInfo = deviceDetectionManager.GetDeviceInformation(userAgent);
return deviceInfo;
}

Issue 3:  In Sitecore 10.2 save/update/adding facet to contact is having different code because some classes as example IContactEmailAddresses” is obsolete post Sitecore in 9.3.

Issue 4:  Needs to upgrade Glassmapper module to 5.8.18 version and post that we have refactor some code as given below. ISitecoreContext has been deprecated, now  we need to use IMVContext instead of this.

Solution: Sample code    IMvcContext gmContext = new MvcContext();

var footer = gmContext.SitecoreService.GetItem<footer >(id);

If you want to get the inherited template and item then in this case pass the InferType property true.

var option=new GetItemsByIDOptions(id){InferType=true;}

var footer = gmContext.SitecoreService.GetItem<footer >( option);

Issue 5: LinkManager changes – In Sitecore 8.2 to get the Item Url using custom options would be achieved by below URL

  • var options = LinkManager.GetDefaultUrlOptions();
  • var url = LinkManager.GetItemUrl(item, options);

Solution : In Sitecore 9.3, the class Sitecore.Links.UrlOptions becomes obsolete as well as all methods that use it. Below is the code sample code which needs to change in Sitecore 10 as well.

  • var options = LinkManager.GetDefaultUrlBuilderOptions();
  • var url = LinkManager.GetItemUrl(item, options);

Migration Of WFFM Form to Sitecore forms POV :

  1. We have used the “WFFM-Conversion-Tool” (https://github.com/afaniuolo/WFFM-Conversion-Tool) and successfully migrated the WFFM form data and Sitecore items to Sitecore 10.2 instance.
  2. All custom action or fields code needs to rewrite manually to work with Sitecore forms.
  3. CSS needs to be change as per Sitecore forms structure WFFM form CSS will not work as it is.

Thanks to Alessandro Faniuolo for creating such amazing tool which helps to all Sitecore community.

There are some more challenges we have faced I will cover all those in next part.