Sitecore 8

Sitecore, Utveckling

Upgrade Sitecore 7.2 to 8.1

I have upgraded a Sitecore 7.2 instance to the latest release 8.1 rev 3. These are my reflections and experiences.

First of all, my approach was to do a clean SC81 instance, serialize all the items from the old instance to the new one and do the configurations.

Invalid Item Names

The first issue was that the process to serialize the items failed. The progress worked fine for a couple of minutes and then stopped showing an asp.net error. I found out that there was a couple of tab character in the Item Name! This is a transcript of the log file:

ManagedPoolThread #7 14:05:22 INFO  Serializing master/sitecore/content/NODE/Product Articles/PRODUCT	 1x25	 400 ml 68453
ManagedPoolThread #7 14:05:22 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Jobs.Job.ThreadEntry(Object state)

Nested Exception

Exception: System.ArgumentException
Message: Illegal characters in path.
Source: mscorlib
   at System.IO.Path.IsPathRooted(String path)
   at Sitecore.Data.Serialization.PathUtils.MapItemPath(String itemPath, String root)
   at Sitecore.Data.Serialization.Manager.DumpItem(Item item)
   at Sitecore.Data.Serialization.Manager.DumpTreeInternal(Item item)
   at Sitecore.Data.Serialization.Manager.DumpTreeInternal(Item item)
   at Sitecore.Data.Serialization.Manager.DumpTreeInternal(Item item)
   at Sitecore.Data.Serialization.Manager.DumpTreeInternal(Item item)
   at Sitecore.Data.Serialization.Manager.DumpTree(Item item)

Serializing the items again and it stopped at another item. This time it was even trickier. There was an enter character in the item name and it was not even possible to see in the GUI or in the log file. Only when pressing F2 (edit Item name), copy the item name and pasting it in a text editor the item name was divided on 2 lines. I deleted the invalid enter character and saved.

Invalid Sitecore Item name

Invalid Sitecore Item name. There is an invisible enter character hidden in this Item Name!

There was about 10 invalid item names (8.010 serialized items). Talking to the editors and we found out that the invalid item names probably had been caused by that some of the content had been entered using copy/paste from an even older SC instance (6.4).

Language Fallback

The Language Fallback was previously an external plugin but is now shipped together with SC81.

An error occured
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Some directories could not be loaded: D:\PATH\Data\serialization\master\sitecore\content\NODE\Modules\ITEM.item ---> Sitecore.Data.Serialization.Exceptions.FieldIsMissingFromTemplateException: Field '__TranslationItemID' does not exist in template 'Folder' at Sitecore.Data.Serialization.ItemSynchronization.PasteField(Item item, SyncField field) at Sitecore.Data.Serialization.ItemSynchronization.PasteVersion(Item item, SyncVersion syncVersion, Hashtable versions, LoadOptions options) at Sitecore.Data.Serialization.ItemSynchronization.PasteSyncItem(SyncItem syncItem, LoadOptions options, Boolean failOnDataInconsistency) at Sitecore.Data.Serialization.Manager.DoLoadItem(String path, LoadOptions options) at Sitecore.Data.Serialization.Manager.DoLoadTree(String path, LoadOptions options) --- End of inner exception stack trace --- at Sitecore.Data.Serialization.Manager.DoLoadTree(String path, LoadOptions options) at Sitecore.Data.Serialization.Manager.LoadTree(String path, LoadOptions options) at Sitecore.Shell.Framework.Commands.Serialization.LoadTreeCommand.LoadItem(Item item, LoadOptions options) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Jobs.Job.ThreadEntry(Object state)

Media Folder

Some of the folders in the Media Gallery structure tree did not serialize.

An error occured
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Some directories could not be loaded: 
D:\SITE\Data\serialization\master\sitecore\media library\FOLDER\ITEM image.item ---> Sitecore.Data.Serialization.Exceptions.ParentItemNotFoundException: Exception of type 'Sitecore.Data.Serialization.Exceptions.ParentItemNotFoundException' was thrown. at Sitecore.Data.Serialization.ItemSynchronization.PasteSyncItem(SyncItem syncItem, LoadOptions options, Boolean failOnDataInconsistency) at Sitecore.Data.Serialization.Manager.DoLoadItem(String path, LoadOptions options) at Sitecore.Data.Serialization.Manager.DoLoadTree(String path, LoadOptions options) --- End of inner exception stack trace --- at Sitecore.Data.Serialization.Manager.DoLoadTree(String path, LoadOptions options) at Sitecore.Data.Serialization.Manager.LoadTree(String path, LoadOptions options) at Sitecore.Shell.Framework.Commands.Serialization.LoadTreeCommand.LoadItem(Item item, LoadOptions options) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Jobs.Job.ThreadEntry(Object state)

Build Solution

Error 6 The type or namespace name ’WebEditCommand’ could not be found (are you missing a using directive or an assembly reference?)

Found the solution here: http://netlab.no/uglemat/the-sitecore-8-upgrade-experience

Sitecore.Shell.Applications.WebEdit.Commands namespace was previously located in the Sitecore.Client.dll. In Sitecore 8, these have been moved to a New Assembly: Sitecore.ExperienceEditor.dll.

I solved it by creating an ordinary Sitecore package for those folders and installed them in the SC81 instance. After that I could revert the item structure using the ”Revert tree” serialize feature.

NuGet issues

When I try to update the System.Web.MVC library using NuGet I´ve got this error in Package Manager Console:
Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of RemoteSigned. Type ”Get-ExecutionPolicy -List” to view your execution policy settings. For more information please see ”Get-Help Set-ExecutionPolicy”.

I tried this solution
https://blogs.msdn.microsoft.com/pasen/2011/12/07/set-executionpolicy-windows-powershell-updated-your-execution-policy-successfully-but-the-setting-is-overridden-by-a-policy-defined-at-a-more-specific-scope/
but our central policy still override the rules

Set-ExecutionPolicy “RemoteSigned” -Scope Process -Confirm:$false
Set-ExecutionPolicy “RemoteSigned” -Scope CurrentUser -Confirm:$false

I finally found the solution here to temporarily get around the issue
https://powershellpanda.wordpress.com/2013/12/01/override-gpo-for-powershell-execution-policy/

Delete the registry key named ExecutionPolicy that is being pushed by the Group Policy object located at Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell

After deleting the registry key I get this message in the Package Manager Console:
Each package is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may include dependencies which are governed by additional licenses. Follow the package source (feed) URL to determine any dependencies.

Package Manager Console Host Version 2.8.60610.756

Type ’get-help NuGet’ to see all available NuGet commands.

PM>

Update NuGet Packages

Run this command in the Package Manager Console (Tools \ NuGet Package Manager \ Manage NuGet Packages for Solution):
Update-Package Microsoft.AspNet.Mvc -Version 5.2.3

Config files

Server Error in ’/’ Application.

No config node found for mvc/areas/excludedAreas!

Resolution found here: http://www.nonlinearcreations.com/Digital/how-we-think/articles/2015/10/Sitecore-8-1-MVC-Improvements-Area-Support-and-MVC-5-2-3.aspx




Page error

Server Error in ’/’ Application.

Could not load file or assembly ’System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The solution was to update the Glass.Mapper.Sc NuGet package and republish these .dll:s.

Glass.Mapper

I updated the ORM Glass.Mapper.Sc library running this command

Install-Package Glass.Mapper.Sc -Version 4.1.2.67

Then I´ve got this error:

Server Error in '/' Application.

You cannot have duplicate mappings for properties. Property Name: Children  Type: StartPage

Description: An unhandled exception occurred. 

Exception Details: Glass.Mapper.MapperException: You cannot have duplicate mappings for properties. Property Name: Children  Type: StartPage

Reading the error message really carefully and I found that the error was caused by nameing conflict in a class that was inheriting from another class.
The solution was just to out comment two properties;

        ///// <summary>
        ///// The Children of the current item
        ///// </summary>
        //public virtual IEnumerable<BaseSiteCoreItem> Children { get; set; }

        ///// <summary>
        ///// The parent of the current item
        ///// </summary>
        //public virtual BaseSiteCoreItem Parent { get; set; }

Language Fallback

There are some changes to the Language Fallback functionality. First of all, it is now shipped together with Sitecore 8 out of the box. Second, the previous Language Fallback fields got new names so all templates that are imported from the old structure has to be reconfigured.

I think I will have to have a closer look at the PowerShell tool to be able to do script updates directly from the SC Admin.

Layout

There is a new Layout field called ”Final Rendering”. This is because the ”Renderings” field is a Shared field by default. Now it is possible to have different renderings on each item version and language version. In our 7.2 instance we had unchecked the Shared field for the Renderings filed to be able to have different layouts on each language version of an item. Now we can go back to default value.

The result is that an item will now have the ability to define presentation details that exist across all versions (Shared – as it has worked in previous versions), as well as the ability to change the presentation details specific to the current version. When combined with the Shared details the result is what’s shown on the ‘Final’ tab (reference link).

Sitecore Rendering Fields

Sitecore Rendering Fields

By  -      


Lämna ett svar

Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *