-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1 lines (1 loc) · 36.3 KB
/
index.html
1
<!-- build time:Sat Mar 25 2017 11:26:14 GMT+0100 (Romance Standard Time) --><!DOCTYPE HTML><html><head><meta charset="utf-8"><title>Sitecorn</title><meta name="author" content="Ruben Verschueren"><meta name="description" content="web development tips & tricks"><meta name="og:description" content="web development tips & tricks"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><meta property="og:site_name" content="Sitecorn"><meta property="og:url" content="http://www.sitecorn.be/index.html"><meta property="og:image" content="http://www.sitecorn.be/images/sitecorn_large.png"><meta property="og:image:width" content="100"><meta property="og:image:height" content="121"><link rel="icon" type="image/png" href="http://www.sitecorn.be/images/fav.ico"><link href="http://www.sitecorn.be/images/sitecorn_large.png" rel="icon"><link rel="alternate" href="/atom.xml" title="Sitecorn" type="application/atom+xml"><link rel="stylesheet" href="/css/style.css" media="screen" type="text/css"><link rel="stylesheet" href="/css/custom.css" media="screen" type="text/css"><script>!function(e,a,t,n,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=a.createElement(t),s=a.getElementsByTagName(t)[0],o.async=1,o.src=n,s.parentNode.insertBefore(o,s)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-76954315-1","auto"),ga("send","pageview")</script></head></html><body><header id="header" class="inner"><div class="alignleft"><h1><a href="/">Sitecorn</a></h1><h2><a href="/">offering a few kernels of knowledge</a></h2></div><nav id="main-nav" class="alignright"><ul><li><a href="/">Home</a></li><li><a href="/archives">Archives</a></li><li><a href="/about">About</a></li></ul><div class="clearfix"></div></nav><div class="clearfix"></div></header><div id="content" class="inner"><div id="main-col" class="alignleft"><div id="wrapper"><article class="post"><div class="post-content"><header><div class="icon"></div><time datetime="2017-03-24T14:55:44.215Z"><a href="/2017/03/24/fixing-WFFM-tracking-field/">2017-03-24</a></time><h1 class="title"><a href="/2017/03/24/fixing-WFFM-tracking-field/">fixing WFFM tracking field</a></h1></header><div class="entry"><p>After installing a the new version of WFFM (8.2) we were seeing broken links on existing form items. Thanks to the lovely broken links gutter, to guide us to this mistake.</p><p>After some googling, as any self respecting developer does when facing a problem for the first time, I found this <a href="https://reasoncodeexample.com/2015/03/26/sitecore-linkdatabase-unrecognized-guid-format/" target="_blank" rel="external">blog post</a>. It seems that the custom XML being stored as the raw value of the Tracking field has had an update in the newer WFFM versions. As suggested in the blog, one way to fix this is by opening the attributes and goals of the tracking field and clicking OK, without making any changes. This updates the XML and as if by magic the gutter disappears.</p><p>So what changed in the raw values? Well in the new version, the events now have an ID attribute. Here is an example of the raw values before the “fix”:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><tracking> </span><br><span class="line"><event name="Field Changed" /> </span><br><span class="line"><event name="Field Completed" /> </span><br><span class="line"><event name="Field Not Completed" /> </span><br><span class="line"><event name="Field Out of Boundary" /> </span><br><span class="line"><event name="Invalid Field Syntax" /></span><br><span class="line"></tracking></span><br></pre></td></tr></table></figure><p>And the raw values afer the “fix”:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><tracking></span><br><span class="line"><event id="{7E86B2F5-ACEC-4C60-8922-4EB5AE5D9874}" name="Field Not Completed" /></span><br><span class="line"><event id="{F3D7B20C-675C-4707-84CC-5E5B4481B0EE}" name="Field Out of Boundary" /></span><br><span class="line"><event id="{844BBD40-91F6-42CE-8823-5EA4D089ECA2}" name="Invalid Field Syntax" /></span><br><span class="line"><event id="{AA3AE715-E87D-4B4D-80C7-4290546F770F}" name="Field Changed" /></span><br><span class="line"><event id="{F0113A93-570A-4F69-8C7C-BA08037D1E34}" name="Field Completed" /></span><br><span class="line"></tracking></span><br></pre></td></tr></table></figure><p>Since I didn’t feel like clicking a thousand times to update 400+ forms (older versions are forms too!) I wrote an admin page to fix it. Here’s the code I used. It might not be the cleanest, but it gets the job done. Just save it as an .ASPX file in your site under /sitecore/admin and you are good to go.</p><figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br></pre></td><td class="code"><pre><span class="line"><%@ Page Language=<span class="string">"C#"</span> %></span><br><span class="line"><%@ Import Namespace=<span class="string">"System"</span> %></span><br><span class="line"><%@ Import Namespace=<span class="string">"System.Collections.Generic"</span> %></span><br><span class="line"><%@ Import Namespace=<span class="string">"System.Linq"</span> %></span><br><span class="line"><%@ Import Namespace=<span class="string">"Sitecore.ContentSearch"</span> %></span><br><span class="line"><%@ Import Namespace=<span class="string">"Sitecore.ContentSearch.SearchTypes"</span> %></span><br><span class="line"><%@ Import Namespace=<span class="string">"Sitecore.Data"</span> %></span><br><span class="line"><%@ Import Namespace=<span class="string">"Sitecore.Data.Items"</span> %></span><br><span class="line"> <script runat=<span class="string">"server"</span> type=<span class="string">"text/C#"</span>></span><br><span class="line"> <span class="keyword">private</span> <span class="keyword">bool</span> authorized = <span class="keyword">false</span>;</span><br><span class="line"> <span class="keyword">private</span> <span class="keyword">string</span> UnauthorizedMessage = <span class="string">"You are not authorized to view this page"</span>;</span><br><span class="line"> <span class="function"><span class="keyword">protected</span> <span class="keyword">void</span> <span class="title">Page_Load</span>(<span class="params"><span class="keyword">object</span> sender, EventArgs e</span>)</span><br><span class="line"> </span>{ </span><br><span class="line"> <span class="keyword">if</span> (!(<span class="keyword">true</span></span><br><span class="line"> <span class="comment">//&& Request.IsSecureConnection // Check for HTTPS </span></span><br><span class="line"> && Request.UserHostAddress == <span class="string">"127.0.0.1"</span></span><br><span class="line"> && Sitecore.Context.IsLoggedIn</span><br><span class="line"> && Sitecore.Context.IsAdministrator</span><br><span class="line"> <span class="comment">//&& Sitecore.Context.User.IsInRole(@"sitecore\Developer") //check for specific role</span></span><br><span class="line"> ))</span><br><span class="line"> {</span><br><span class="line"> Response.StatusCode = (<span class="keyword">int</span>) System.Net.HttpStatusCode.Forbidden;</span><br><span class="line"> Response.Write(UnauthorizedMessage);</span><br><span class="line"> Response.TrySkipIisCustomErrors = <span class="keyword">true</span>;</span><br><span class="line"> Response.End();</span><br><span class="line"> <span class="keyword">return</span>;</span><br><span class="line"> }</span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> {</span><br><span class="line"> authorized = <span class="keyword">true</span>;</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> } </span><br><span class="line"></span><br><span class="line"> <span class="function"><span class="keyword">protected</span> <span class="keyword">void</span> <span class="title">FixFields_OnClick</span>(<span class="params"><span class="keyword">object</span> sender, EventArgs e</span>)</span><br><span class="line"> </span>{</span><br><span class="line"> <span class="keyword">if</span> (!authorized)</span><br><span class="line"> {</span><br><span class="line"> output.InnerHtml = <span class="keyword">string</span>.Format(<span class="string">"<div style=\"color:red;\">{0}"</span>, UnauthorizedMessage);</span><br><span class="line"> <span class="keyword">return</span>;</span><br><span class="line"> }</span><br><span class="line"> ID formTemplateId = <span class="keyword">new</span> ID(<span class="string">"{FFB1DA32-2764-47DB-83B0-95B843546A7E}"</span>);</span><br><span class="line"> ID contenTreeId = <span class="keyword">new</span> ID(<span class="string">"{0DE95AE4-41AB-4D01-9EB0-67441B7C2450}"</span>);</span><br><span class="line"> ISearchIndex index = ContentSearchManager.GetIndex(<span class="string">"sitecore_master_index"</span>);</span><br><span class="line"> <span class="keyword">string</span> TrackingFieldName = <span class="string">"__tracking"</span>;</span><br><span class="line"> <span class="keyword">int</span> changeCount = <span class="number">0</span>;</span><br><span class="line"> <span class="keyword">int</span> errorCount = <span class="number">0</span>;</span><br><span class="line"> output.InnerHtml += <span class="string">"<div>Starting update of fields</div>"</span>;</span><br><span class="line"></span><br><span class="line"> Dictionary<<span class="keyword">string</span>, <span class="keyword">string</span>> replacements = GetReplacements();</span><br><span class="line"> List<Item> indexResults = <span class="keyword">null</span>;</span><br><span class="line"> <span class="keyword">using</span> (IProviderSearchContext context = index.CreateSearchContext())</span><br><span class="line"> {</span><br><span class="line"> indexResults = context.GetQueryable<SearchResultItem>()</span><br><span class="line"> .Where(x => x.TemplateId == formTemplateId</span><br><span class="line"> && x.Paths.Contains(contenTreeId))</span><br><span class="line"> .Select(x => x.GetItem()).ToList();</span><br><span class="line"></span><br><span class="line"> indexResults = indexResults.Where(x => x != <span class="keyword">null</span>).Where(x => x.Fields[TrackingFieldName] != <span class="keyword">null</span>).ToList();</span><br><span class="line"> <span class="keyword">if</span> (!indexResults.Any())</span><br><span class="line"> {</span><br><span class="line"> output.InnerHtml += <span class="string">"<div>No Form items found to modify. </div>"</span>;</span><br><span class="line"> <span class="keyword">return</span>;</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="keyword">foreach</span> (Item item <span class="keyword">in</span> indexResults)</span><br><span class="line"> {</span><br><span class="line"> <span class="keyword">try</span></span><br><span class="line"> {</span><br><span class="line"> <span class="keyword">string</span> <span class="keyword">value</span> = item.Fields[TrackingFieldName].Value;</span><br><span class="line"> <span class="keyword">foreach</span> (<span class="keyword">var</span> dictionaryItem <span class="keyword">in</span> replacements)</span><br><span class="line"> {</span><br><span class="line"> <span class="keyword">value</span> = <span class="keyword">value</span>.Replace(dictionaryItem.Key, dictionaryItem.Value);</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> item.Editing.BeginEdit();</span><br><span class="line"> <span class="keyword">using</span> (<span class="keyword">new</span> EditContext(item))</span><br><span class="line"> {</span><br><span class="line"> item.Fields[TrackingFieldName].Value = <span class="keyword">value</span>;</span><br><span class="line"> output.InnerHtml += <span class="keyword">string</span>.Format(<span class="string">"<div>Item - {0} - changed</div>"</span>, item.Name);</span><br><span class="line"> }</span><br><span class="line"> item.Editing.EndEdit();</span><br><span class="line"> changeCount++;</span><br><span class="line"> }</span><br><span class="line"> <span class="keyword">catch</span> (Exception ex)</span><br><span class="line"> {</span><br><span class="line"> output.InnerHtml += <span class="keyword">string</span>.Format(<span class="string">"<div>Item - {0} - {1}</div>"</span>, item.Name, ex.Message);</span><br><span class="line"> errorCount++;</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> output.InnerHtml += <span class="keyword">string</span>.Format(<span class="string">"<div>Update of tracking fields finished. {0} items modified, {1} errors ocurred. </div>"</span>, changeCount, errorCount);</span><br><span class="line"> </span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="keyword">private</span> Dictionary<<span class="keyword">string</span>, <span class="keyword">string</span>> GetReplacements()</span><br><span class="line"> {</span><br><span class="line"> Dictionary<<span class="keyword">string</span>, <span class="keyword">string</span>> replacements = <span class="keyword">new</span> Dictionary<<span class="keyword">string</span>, <span class="keyword">string</span>>();</span><br><span class="line"> replacements.Add(<span class="string">"<event name=\"Field Changed\" />"</span>, <span class="string">"<event id=\"{AA3AE715-E87D-4B4D-80C7-4290546F770F}\" name=\"Field Changed\" />"</span>);</span><br><span class="line"> replacements.Add(<span class="string">"<event name=\"Field Completed\" />"</span>, <span class="string">"<event id=\"{F0113A93-570A-4F69-8C7C-BA08037D1E34}\" name=\"Field Completed\" />"</span>);</span><br><span class="line"> replacements.Add(<span class="string">"<event name=\"Field Not Completed\" />"</span>, <span class="string">"<event id=\"{7E86B2F5-ACEC-4C60-8922-4EB5AE5D9874}\" name=\"Field Not Completed\" />"</span>);</span><br><span class="line"> replacements.Add(<span class="string">"<event name=\"Field Out of Boundary\" />"</span>, <span class="string">"<event id=\"{F3D7B20C-675C-4707-84CC-5E5B4481B0EE}\" name=\"Field Out of Boundary\" />"</span>);</span><br><span class="line"> replacements.Add(<span class="string">"<event name=\"Invalid Field Syntax\" />"</span>, <span class="string">"<event id=\"{844BBD40-91F6-42CE-8823-5EA4D089ECA2}\" name=\"Invalid Field Syntax\" />"</span>);</span><br><span class="line"></span><br><span class="line"> <span class="keyword">return</span> replacements;</span><br><span class="line"> } </span><br><span class="line"> </script></span><br><span class="line"><!DOCTYPE html></span><br><span class="line"><html xmlns=<span class="string">"http://www.w3.org/1999/xhtml"</span>></span><br><span class="line"><head runat=<span class="string">"server"</span>></span><br><span class="line"> <title>WFFM <span class="number">8.2</span> fix tracking field</title></span><br><span class="line"></head></span><br><span class="line"><body></span><br><span class="line"> <form id=<span class="string">"trackingUpdater"</span> runat=<span class="string">"server"</span>></span><br><span class="line"> <h3>Update tracking field <span class="keyword">for</span> WFFM form items</h3></span><br><span class="line"> <div style=<span class="string">"margin-left:15px;"</span>></span><br><span class="line"> Click the button below to fix the Tracking field <span class="keyword">for</span> WFFM forms. This will add ID attributes to the selected items <span class="keyword">in</span> <span class="keyword">this</span> field.</span><br><span class="line"> Modify the dictionary to replace more/less <span class="keyword">as</span> needed.</span><br><span class="line"> <br/><br/></span><br><span class="line"> <asp:Button runat=<span class="string">"server"</span> ID=<span class="string">"FixFields"</span> OnClick=<span class="string">"FixFields_OnClick"</span> Text=<span class="string">"Update form tracking field"</span> /></span><br><span class="line"> </div></span><br><span class="line"> <div id=<span class="string">"output"</span> runat=<span class="string">"server"</span> style=<span class="string">"width: 1000px; height: 500px; overflow-scrolling: auto;"</span>></span><br><span class="line"> </div></span><br><span class="line"> </form></span><br><span class="line"></body></span><br><span class="line"></html></span><br></pre></td></tr></table></figure><p>The dictionary can be easily expanded in case you selected any other goals or attributes in this field. I only added the ones that I had selected in my forms.</p></div><footer><div class="clearfix"></div></footer></div></article><article class="post"><div class="post-content"><header><div class="icon"></div><time datetime="2017-03-17T09:11:50.413Z"><a href="/2017/03/17/upgrade-sitecore-6-5-to-8-2-part-3/">2017-03-17</a></time><h1 class="title"><a href="/2017/03/17/upgrade-sitecore-6-5-to-8-2-part-3/">upgrade-sitecore 6.5 to 8.2 - part 3</a></h1></header><div class="entry"><blockquote><p>Reality check</p></blockquote><p>In <a href="http://www.sitecorn.be/2016/10/19/upgrade-sitecore-6-5-to-8-2-part-2/">part 2</a> 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.</p><p>Here are the high level steps I took to get to 8.2:</p><ul><li>Made backup of site and databases</li><li>Updated config files to 6.6 in VS solution</li><li>Updated dll references in solution to new sitecore dll versions</li><li>Updated dll references to 3rd party modules</li><li>Referenced new version of HTMLAgilityPack</li></ul><p>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.</p><p>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.</p><p>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.</p><p>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.</p><p>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).</p><p>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.</p><p>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.</p><p><strong>A note on templates</strong></p><p>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.</p><div class="figure"><img src="/images/TemplateInheritanceBug.png" title="Template Inheritance bug"></div><p>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.</p><div class="figure"><img src="/images/RawValuesSelected.png" title="View Raw values"></div><div class="figure"><img src="/images/StandardTemplateBasetemplates.png" title="standard template base templates"></div><p>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:</p><ul><li>Appearance section : **_Preview** field</li><li>Layout section : **_Controller** field</li><li>Tasks : **_Archive Version date** field</li></ul><p>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 <strong>core</strong> 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.</p></div><footer><div class="clearfix"></div></footer></div></article><article class="post"><div class="post-content"><header><div class="icon"></div><time datetime="2016-10-19T09:51:20.985Z"><a href="/2016/10/19/upgrade-sitecore-6-5-to-8-2-part-2/">2016-10-19</a></time><h1 class="title"><a href="/2016/10/19/upgrade-sitecore-6-5-to-8-2-part-2/">upgrade sitecore 6.5 to 8.2 - part 2</a></h1></header><div class="entry"><blockquote><p>On second thought…</p></blockquote><p>In <a href="http://www.sitecorn.be/2016/10/07/upgrade-sitecore-6-5-to-8-2-part1/">part 1</a> I described my temporary plan of attack for upgrading a Sitecore 6.5 project to 8.2. After a nice discussion on the Sitecore community slack I revised my initial plan. Basically I’m going to attach the existing databases to a vanilla site setup and upgrade. Separately I’ll upgrade the code and config to work with a 8.2 site. Finally the two will be linked, resulting in a perfect 8.2 project… or at least that’s the idea and it will have an old(er) codebase.</p><p>As for the code part only necessary changes will be made to get everything up and running. meaning changing or upgrading modules and rewriting code if needed. Sadly that means a lot of sheer UI and webforms code will remain for now.</p><p>The preparation plan will be mostly the same so I’ll leave it out in this post. The upgrade strategy has been changed and is now more detailed.</p><p><strong>Sitecore database upgrade</strong></p><ol style="list-style-type:decimal"><li>Stop development</li><li>Clear publishing and event queues. set longer timeouts in web.config</li><li>Shrink and rebuild db indexes</li><li>Update all environments with production content (take care not to loose not deployed development)</li><li>Link to vanilla site installations</li><li>Upgrade to version 7.2 (or whichever version is supported by then)</li><li>Use Express Migration Tool to upgrade to sitecore version 8.2</li><li>Backup analysis and upgrade reports and logs</li></ol><p><strong>Steps for upgrading new site to next version</strong></p><ol style="list-style-type:decimal"><li>Backup master/core/web/analytics databases of previous version</li><li>Restore backups to DB’s with new version number</li><li>Change app_config/connectionstrings.config to point to new databases (which are still in older version)</li><li>Upgrade databases to new version</li></ol><p>Refer to my post on <a href="http://www.sitecorn.be/2016/10/17/duplicate-sql-databases-in-bulk/">bulk duplicating databases</a> to see how I make the backups and restore duplicates.</p><p><strong>Code / file upgrade</strong></p><ol style="list-style-type:decimal"><li>Modify/upgrade config files to Sitecore version 8.2.</li><li>Refactor code for Sitecore 8.2, commenting out all broken (third party or custom) code.</li><li>Build/deploy this minimal version.</li><li>Use the vanilla site versions until 8.2 is reached</li><li>After upgrading databases, start deploying (working parts of) the code</li><li>Gradually fix the code and update/replace the modules as needed</li><li>Start updating the broken code / modules.</li><li>Deploy version 8.2 (without modules) to staging or whatever temporary QA site</li><li>Have key users verify the minimal 8.2 version on staging or whatever temporary QA site</li><li>Build and deploy upgraded code</li><li>Have key users retest entire site.</li></ol><p><strong>Steps for updating code to 8.2 version</strong></p><ol style="list-style-type:decimal"><li>Branch code</li><li>Modify publish settings and other references to site -> vanilla version 8.2</li><li>Change all references for Sitecore version 6.5 to version 8.2</li><li>Build, bugfix and deploy to site version 8.2</li><li>Run (smoke) tests on site 8.2 (still with vanilla db)</li></ol><p><strong>Link upgraded databases to upgraded site files</strong></p><ol style="list-style-type:decimal"><li>Backup Site and upgraded databases</li><li>Change connection strings to upgraded database</li><li>Test, bugfix and retest</li></ol></div><footer><div class="clearfix"></div></footer></div></article><nav id="pagination"><a href="/page/2/" class="alignright next">Next</a><div class="clearfix"></div></nav></div></div><aside id="sidebar" class="alignright"><a href="https://twitter.com/RubenVerschuern" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @RubenVerschuern</a><script>!function(t,e,r){var n,s=t.getElementsByTagName(e)[0],i=/^http:/.test(t.location)?"http":"https";t.getElementById(r)||(n=t.createElement(e),n.id=r,n.src=i+"://platform.twitter.com/widgets.js",s.parentNode.insertBefore(n,s))}(document,"script","twitter-wjs")</script><div class="widget tag"><h3 class="title">Tags</h3><ul class="entry"><li><a href="/tags/wffm-8-2/">WFFM 8.2</a><small>1</small></li><li><a href="/tags/adyen-skin/">adyen skin</a><small>1</small></li><li><a href="/tags/autocomplete/">autocomplete</a><small>1</small></li><li><a href="/tags/blog/">blog</a><small>1</small></li><li><a href="/tags/browser-extensions/">browser extensions</a><small>1</small></li><li><a href="/tags/bug/">bug</a><small>1</small></li><li><a href="/tags/cheat-sheet/">cheat sheet</a><small>1</small></li><li><a href="/tags/extension-methods/">extension methods</a><small>1</small></li><li><a href="/tags/fieldtype-error/">fieldtype error</a><small>1</small></li><li><a href="/tags/filter/">filter</a><small>1</small></li><li><a href="/tags/google-maps/">google maps</a><small>1</small></li><li><a href="/tags/hpp/">hpp</a><small>1</small></li><li><a href="/tags/itemlink/">itemlink</a><small>1</small></li><li><a href="/tags/javascript/">javascript</a><small>2</small></li><li><a href="/tags/maintenance/">maintenance</a><small>1</small></li><li><a href="/tags/markdown/">markdown</a><small>1</small></li><li><a href="/tags/mediarequest/">mediarequest</a><small>1</small></li><li><a href="/tags/migrate/">migrate</a><small>4</small></li><li><a href="/tags/multiple-renderings/">multiple renderings</a><small>1</small></li><li><a href="/tags/mvc/">mvc</a><small>1</small></li><li><a href="/tags/pdf/">pdf</a><small>1</small></li><li><a href="/tags/plugins/">plugins</a><small>1</small></li><li><a href="/tags/resharper/">resharper</a><small>1</small></li><li><a href="/tags/shortcut/">shortcut</a><small>1</small></li><li><a href="/tags/sitecore/">sitecore</a><small>5</small></li><li><a href="/tags/sitecore-8/">sitecore 8</a><small>4</small></li><li><a href="/tags/sql/">sql</a><small>3</small></li><li><a href="/tags/sql-server/">sql server</a><small>1</small></li><li><a href="/tags/t-sql/">t-sql</a><small>1</small></li><li><a href="/tags/template-inheritance/">template inheritance</a><small>1</small></li><li><a href="/tags/tools/">tools</a><small>1</small></li><li><a href="/tags/ucommerce/">ucommerce</a><small>3</small></li><li><a href="/tags/unit-testing/">unit testing</a><small>1</small></li><li><a href="/tags/upgrade/">upgrade</a><small>4</small></li><li><a href="/tags/visual-studio/">visual studio</a><small>1</small></li></ul></div></aside><div class="clearfix"></div></div><footer id="footer" class="inner"><div class="alignleft">© 2017 Ruben Verschueren</div><div class="clearfix"></div></footer><script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script><script src="/js/jquery.imagesloaded.min.js"></script><script src="/js/gallery.js"></script><script type="text/javascript">var disqus_shortname="sitecorn";!function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src="//"+disqus_shortname+".disqus.com/count.js",(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(e)}()</script><link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css"><script src="/fancybox/jquery.fancybox.pack.js"></script><script type="text/javascript">!function(n){n(".fancybox").fancybox()}(jQuery)</script></body><!-- rebuild by neat -->