upgrade-sitecore 6.5 to 8.2 - part 3

Reality check

In part 2 I talked about manually upgrading 6.5 to 7.2 and then using the Express Migration Tool, to take it to 8.2. Fortunately, by the time I got started, 6.6 was already supported by EMT.

Here are the high level steps I took to get to 8.2:

  • Made backup of site and databases
  • Updated config files to 6.6 in VS solution
  • Updated dll references in solution to new sitecore dll versions
  • Updated dll references to 3rd party modules
  • Referenced new version of HTMLAgilityPack

The third step was the most annoying here. I had to download the source code of the modules, replace the sitecore references and recompile. Most of them worked with minor tweaking here and there, so I could add them back into my VS solution. The project also heavily relied on 3rd party implementations of the company that originally developed the solution. This included (but was certainly not limited to) a custom buckets setup that didn’t really work well on a split CM and CD setup. I removed all of the references to their dll’s and started commenting out code until my project would build.

After this was done I was finally running on Sitecore 6.6 with a semi-disabled custom solution. Time for the EMT to do it’s thing…. and it did. after a few hours my site was upgraded to Sitecore 8.2. This meant it was once again time to update my sitecore references, comment out or modify code specific to 6.6 and get my VS solution to build again.

Once that was done I had a running 8.2 solution and a very ugly website with very few functionality. Time to bucle down and deep dive into the code, fixing commented out code and rewriting parts that were bugging me.

Deciding what to keep, what to change and what to throw out and rebuild is the biggest challenge in a project like this. Unfortunately I can’t give you any clear answers here but I would suggest to change only what’s needed.

I started with adding code generation for templates and a few item locations because I did not want to keep updating the existing POCO classes and “FieldInfo” classes. Hard coded strings give me nightmares, so I’ll let TDS worry about that and generate some code for me. After that I changed the way the 3rd party had implemented repositories (aka Search), configuration (which are items with a ton of fields) and dictionary (again custom).

Since this is now an 8.2 I thought I’d get on board with Helix and made these parts as foundations and/or features. Now if you’re reading this, you’re in the same boat as me so don’t do what I did next. I made a nice foundation for the base functionality of the repositories and started to move the concrete ones into helix features.

Turns out these existing repositories liked to keep their POCO classes close and the FieldInfo classes and they like their own POCO’s and FieldInfo’s and … You can guess the rest. after a few days of messing about, I had around 40 foundations with a lot of references between them. It may not be the best setup, but at least it provides a better view on what is in this project.

A note on templates

A problem that seems to occur with sitecore upgrades is the template inheritance tab being broken. There is usually a YSOD pointing to the fieldtype.

The easiest albeit time consuming method of fixing this is opening the template that has the bug (since not all of them may be affected). Switch on Raw Values and copy the contents of the base templates field to your favourite text editor.

I’m sure you can guess where this is going, open the templates belonging to these templates and set field types for those fields that have none selected. When you’ve gone through all of them the error should be gone. In my case there were some field sections on the standard template that were causing the issue. The following fields had no field type:

  • Appearance section : **_Preview** field
  • Layout section : **_Controller** field
  • Tasks : **_Archive Version date** field

In case this didn’t fix your problem there was an old bug in the sitecore 6-ish versions. In that case it was the _Owner field. Switch to the core database. open your content editor and select /sitecore/templates/System/Templates/Sections/Security Finally assign a “Single-Line Text” field type to the __Owner field. And that’s the end of that YSOD.