The Sitecore 8 Upgrade Experience

Sitecore 8 is out!

And we have looked forward to that ever since we saw it on the Sitecore Symposium in Las Vegas back in October. The 19th of December (2014) it was here, and we started upgrading one of our ongoing Projects. Since everything with Sitecore 8 is about Experience, I'll elaborate on Our Upgrade Experience.  I started by downloading the new Sitecore 8 Upgrade package from the new and improved dev.sitecore.net. Sitecore made a very good guide to follow - Upgrade guide. After completing the upgrade process I tried run my existing site. The following was the things I need to do to get it to work:

Remember to disable all custom config files before update

In our case we have a custom ItemNameValidation rule, that restricts the use of hyphens "-".

<!--<setting name="ItemNameValidation">
<patch:attribute name="value">^[\w\*\$][\w\s\$]*(\(\d{1,}\)){0,1}$</patch:attribute>
</setting>-->

I didn't disable that before installation of the update package, and that resulted in 160 items that wasn't installed. So after reinstalling without the itemNameValidation setting, it worked.

A new Assembly Sitecore.ExperienceEditor has been introduced

Could not load type 'Sitecore.Shell.Applications.WebEdit.Commands.New' from assembly 'Sitecore.Client, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null'.

In Netlab we use a startup website package we call BackPack. It's a set of a lot of frontend modules, that basically gets you started on building your website real quick. So in upgrading this customer we also needed to upgrade our BackPack packages to Sitecore 8.

Since BackPack is build for the Page Editor or Experience Editor as it is called in Sitecore 8, we also use a lot of buttons in the Page Editor. These inherited in earlier versions from Sitecore.Shell.Applications.WebEdit.Commands namespace which was located in the Sitecore.Client.dll. But in Sitecore 8, these have been moved to a New Assembly: Sitecore.ExperienceEditor.dll.

So the solution to that error was to add a Reference to the new Assembly in Visual Studio and rebuild towards it. We don't need to update any namespaces, since they are the same.

[Edit: 6th of janary 2015]
Working With Sitecore 8 for some extra weeks, and testing it further more, we found another change in the APIs of Sitecore 8, compared to earlier Versions. It appears that in Sitecore 8 this piece of code failed in the Run Method of the descendent class of
Sitecore.Shell.Applications.WebEdit.Commands.New:

string shortId = strArray[0];
BranchItem item = Sitecore.Client.ContentDatabase.Branches[shortId, itemNotNull.Language];
Assert.IsNotNull(item, typeof(BranchItem));

The reason is that in Sitecore 8 the Database.Branches class does not accept ShortIDs any more. They only accepts IDs. So we need to add this:

string itemId = strArray[0];
if (ShortID.IsShortID(itemId))
{
     itemId = ShortID.Parse(shortId).ToID().ToString();
}
BranchItem item = Sitecore.Client.ContentDatabase.Branches[itemId, itemNotNull.Language];
Assert.IsNotNull(item, typeof(BranchItem));

 

That fixed it.
[Edit: 6th of janary 2015 end]

Remember to update the search indexes

Because I got that error when running Sitecore or the site, it couldn't update the indexes right away, and that gave other bugs on my site whereever I used the Sitecore Search. It complained that it couldn't parse the CreatedDate property of the SitecoreUISearchResultItem. The solution was to rebuild the master, web and core search indexes, like the guide describes.

Standard values Field wasn't found in core database

When running the site i investigated the following bugs in the log:

9448 13:24:35 WARN  The standard values field of template /sitecore/client/Business Component Library/Layouts/Renderings/Common/GlobalLogo/GlobalLogo:{C9074FE9-9F1F-4838-8737-4158C0F7AA58} does not contain an ID that points to a child
2956 13:20:30 WARN  The standard values field of template /sitecore/client/Speak/Templates/Rendering Parameters/ControlBase:{6A9A5956-5354-48B4-A25A-DABABA738424} does not contain an ID that points to a child

It seemed that both of these items in the core database pointed to a standard value item that didn't exist. So comparing With a clean Sitecore 8 installation, both these items has other standardvalues than in my Upgrade package. I updated to point to the correct IDs and then it worked.

Disable snap.css in Page Editor mode

In Our case we use the Snap.js module, which is a JavaScript module for creating a slide in menu. It seemed that this module removed the Page Editor functionality. So I needed to disable the loading of the snap.css in Page Editor, and then it worked:

<link id="lnkSnapCss" runat="server" href="/css/snap.css" rel="stylesheet">
if (Sitecore.Context.PageMode.IsPageEditor){
      lnkSnapCss.Visible = false;
}

 

So basically there we little that needed to be changed to Upgrade from Sitecore 7.5 to Sitecore 8, except for the recompilation towards the New Assembly. After logging in, we now view the much improved Launch Pad:

 

I might add that you also need to Enable the Analytics, setup Mongo, etc. to get the various Apps in Sitecore 8 to work. Ie if you haven't enabled Analytics the New Sitecore Experience Explorer will Return a bug. I Guess Sitecore will fix that. Looking forward to working With Sitecore 8 even more.