<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Subbu's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/subbu/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/subbu/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:51:58 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Issues while migrating Content Type from SP 2007 to SP2010</title>
      <link>https://docs.microsoft.com/archive/blogs/subbu/issues-while-migrating-content-type-from-sp-2007-to-sp2010</link>
      <pubDate>Sun, 20 May 2012 13:25:00 GMT</pubDate>
      <dc:creator><![CDATA[SubrahmanyamK]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/subbu/2012/05/20/issues-while-migrating-content-type-from-sp-2007-to-sp2010/</guid>
      <description><![CDATA[Content Types have been an integral part of SharePoint and I have seen some issues being faced while...]]></description>
      <content:encoded><![CDATA[<p>Content Types have been an integral part of SharePoint and I have seen some issues being faced while migrating the content types from SharePoint 2007 to SharePoint 2010.</p>
<p>Here i would like to mention about some of the issues I have faced during the migration of some custom content types which were being deployed using features from SP2007 to SP2010 environment.</p>
<p>The two&nbsp;common exceptions i have noticed are:</p>
<p><strong>Case 1:</strong>The element of type 'ContentType' for feature 'xyzContentType' (id: xxxx-xxx-xxx-....) threw an exception during activation: The local device name is already in use. (Exception from HRESULT: 0x80070055)</p>
<p>Feature Activation: Threw an exception, attempting to roll back.&nbsp; Feature 'xyzContentType' (ID: 'xxxx-xxx-xxxx.....').&nbsp; Exception: Microsoft.SharePoint.SPException: The local device name is already in use. (Exception from HRESULT: 0x80070055)&nbsp;System.Runtime.InteropServices.COMException (0x80070055): The local device name is already in use. (Exception from HRESULT: 0x80070055)&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.Library.SPRequestInternalClass.ThrowError(Int32 dwErr)&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.Library.SPRequest.ThrowError(Int32 dwErr)&nbsp;&nbsp;&nbsp;&nbsp; --- End of inner exception stack trace ---&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionFieldsAndContentTypes(SPFeaturePropertyCollection props, SPSite site, SPWeb web, Boolean fForce)&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, Boolean fForce)&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce)<br /><br /><strong>Case 2:</strong> Unable to locate the xml-definition for CType with SPContentTypeId '0x010100C568DB52D9D0A14........', exception: Microsoft.SharePoint.SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))&nbsp; System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)&nbsp;&nbsp;&nbsp;&nbsp; -<br />&nbsp;-- End of inner exception stack trace ---&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)&nbsp;&nbsp;&nbsp; <br />&nbsp;at Microsoft.SharePoint.SPContentTypeCollection.FillCollection(SPRequest req, SqlDataReader rdr, Boolean openWeb)</p>
<p>The exceptions by themselves are pretty clear and tell us the exact problem. But getting them resolved sometimes is a little tricky.</p>
<p>In the Case 1 scenario, it is obvious that the message says, the content type already exists. This may be because you had a feature in SP2007 that deploys the content type and after migration to SP2010 you are trying to deploy the same feature again. A look at the method "SPElementDefinitionCollection.ProvisionFieldsAndContentTypes()" gives us some idea. We can add the attribute "<strong><span style="color: red;">Overwrite</span><span style="color: blue;">=</span>"</strong><strong><span style="color: blue;">TRUE</span></strong><strong>" </strong>to the content type definition xml and deploy again.The "unable to locate the xml-definition for CType... " exception is also likely to be resolved by adding the Overwrite=True attribue and if feature gets redeployed succesfully.</p>
<p>But in somecases this might still not resolve the issue. The reason in my case was a mismatch in the folder paths to the content type elements.xml file. i.e. in SP2007 code the path might have been "Features\CompanyName\MyContentType\Elements.xml". But in SP2010 case, (since i have used the WSP import functionality provided by sharepoint to import the SP2007 package and modify it accordingly) the path was different like "Features\CompanyName\ModuleName\MyContentType\Elements.xml"</p>
<p>A look at the method "SPRequest.GetGlobalContentTypeXml()" shows that the relative path to the element manifest file is considered in order to locate the definition file. But since the old and new paths are different, all the page layouts or lists etc which used the content type are still unable to locate the content type xml file.</p>
<p><strong>Resolution: </strong>If you are upgrading to SP2010 and if you notice a difference in the relative paths, then change the new path to match the old one exactly. This will ensure that all the previous items that were dependent on the content type function properly without any furthur change. If you want to go ahead with the new relative path,&nbsp;then ensure that before migration you have deactivated the feature that&nbsp;has content type properly and have removed the association to all the lists, pagelayouts&nbsp;etc that use this content type. After migration and upgrading, you can associate them back (Note: I have not tried the second&nbsp;approach)</p>
<p>After you have used the above resolution steps of choice, you may have to update the Content Type as well. The following piece of code shows how to do it:</p>
<pre class="scroll"><code class="csharp">foreach (SPWeb w in site.AllWebs)<br /> {<br /> SPContentType contType = w.ContentTypes["ContentTypeName"];<br /> if(contType != null)<br /> </code><code class="csharp"> contType.Update(true);<br /> }<br /> </code></pre>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Fixing Test-SPContentDatabase warnings</title>
      <link>https://docs.microsoft.com/archive/blogs/subbu/fixing-test-spcontentdatabase-warnings</link>
      <pubDate>Sat, 19 May 2012 11:36:00 GMT</pubDate>
      <dc:creator><![CDATA[SubrahmanyamK]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/subbu/2012/05/19/fixing-test-spcontentdatabase-warnings/</guid>
      <description><![CDATA[Test-SPContentDatabase cmdlet usage is almost an integral part of any SharePoint 2007 to SharePoint...]]></description>
      <content:encoded><![CDATA[<p style="margin: 0cm 0cm 0pt;"><span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt;">Test-SPContentDatabase cmdlet usage is almost an integral part of any SharePoint 2007 to SharePoint 2010 migration. <o:p></o:p></span></p>
<p style="margin: 0cm 0cm 0pt;"><span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt;">More about the internals of Test-SPContentDatabase can be found at one of my post <a title="Little more about Test-SPContentDatabase cmdlet" href="https://blogs.msdn.com/b/subbu/archive/2012/05/19/little-more-about-test-spcontentdatabase-cmdlet.aspx" target="_blank">here<o:p></o:p></a></span></p>
<h3>Fixing Missing Feature Warnings:</h3>
<p>The missing feature warning shows: "The feature with Id [FEATURE ID] is referenced in the database [CONTENT DB NAME], but not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contain the feature and restart upgrade if necessary"</p>
<p>We can find the name of the feature from the feature id shown by searching the 12 hive features folder. I Usuall use Visual Studio search to search content inside the files. Once we find the feature name, decision has to be made whether it is a required feature, or a feature thats is not needed and has to be deactivated.</p>
<p>The missing feature warning might come because of two reasons, one if the corresponding site in which the feature is present is locked in which case unlocking the site should remove the warning or two, the feature is actually not installed in the server.</p>
<p><strong>Case 1:</strong>&nbsp; To know what are the sites that are using this feature, the following query can be run against the content database:</p>
<pre class="scroll"><code class="mysql">Select * from Webs where SiteId in <br /> (select SiteId from Features <br /> where FeatureId = '&lt;feature Id&gt;')</code></pre>
<p class="scroll"><code class="mysql"></code>From the list of sites obtained, if the feature is deactivated from those sites, the missing feature warning is likely to be removed.</p>
<p><strong>Case 2:</strong> In some scenarios, i have noticed that the deactivation of feature will still not remove the warning even though the above query returns 0 results. The reason for it is that the feature might have been deactivated all right from all the corresponding sites, but the reference to the feature might still be present in the database. Run the below query to see the remaining references:</p>
<pre class="scroll"><code class="mysql">SELECT * From AllLists (NOLOCK) <br /> WHERE tp_FeatureId = '&lt;feature id&gt;'</code></pre>
<p class="scroll"><code class="mysql"></code>The above query shows all the rows in 'AllLists' table which still refer to the feature. The reason for it is that, some of the features might have had a feature activation code through which the specified lists or document libraries have been created. If those features did not have a feature deactivation code to deal with it, the references still remain.</p>
<p>One way to deal with this is to delete the corresponding lists or doc libraries if they are no longer needed. The other way that worked for me is to take the backup of the list first, then delete the list from the site and create the list manually again from the backup. That way i did not lose the data and the feature reference is removed too.</p>
<p><strong>Case 3:</strong> In some very rare cases, i have noticed that there was an 'Object reference found' error in the log. Upon dwelling long on the reason and checking the database, i have noticed that there are&nbsp;duplicate entries in the 'Features' table with same feature id. Ideally, there should not be duplicate entries in the features table. I am not sure about how the duplicate entries might got added, but the noticable thing was the relative folder path was different.</p>
<p>i.e. the previous path to the feature was something like <strong>"Features\MyCompanyName\MyCustomFeature\Feature.xml"</strong> and the new path is something like <strong>"Features\MyCompanyName\TotalCustomFeatures\MyCustomFeature\Feature.xml"</strong></p>
<p>The only thing i could do was to delete the entry directly from the 'Features' table directly for the obsolete entry. (Not advisable)</p>
<h3>Fixing Missing Setup Files Warnings:</h3>
<p>The missing setup file warning shows: "File [Features\...\abc.xyz] is referenced [n] times in the database [CONTENT DB NAME], but is not installed on the current farm. Please install any feature/solution which contains this file."</p>
<p>The following query can be used to find the list of all the missing setup files present in the sites:</p>
<pre class="scroll"><code class="mysql">select DirName, LeafName from alldocs where SetupPath in <br /> ( <br /> '..\missingFile1.master', <br /> '..\missingFile2.webpart',<br /> and so on...,<br /> ...<br /> )<br /> </code></pre>
<p>Once the list of files is known, we can opt to either delete them from the sites if not needed or install the corresponding package and feature if the files are needed.</p>
<h3>Fixing Missing Webpart Error:</h3>
<p>The missing webpart error shows : "WebPart class [WEBPART CLASS ID] is referenced [n] times in the database [CONTENT DB NAME], but is not installed on the current farm. Please install any feature/solution which contains this web part."</p>
<p>The following query can be used to find the list of all the pages which contain the missing webpart:</p>
<pre class="scroll"><code class="mysql">Select AllDocs.SiteId,WebId,<br /> Webs.Title as 'Web Title', ListId,<br /> DirName,LeafName from AllDocs<br /> inner join WebParts on<br /> Alldocs.Id = Webparts.tp_PageUrlIDinner<br /> join Webs on Alldocs.WebId = webs.Id <br /> where Webparts.tp_WebPartTypeId ='&lt;webpartclassid&gt;'</code></pre>
<p>From the query result, we can get the page urls which contain the error webpart. We can open the corresponding page (append ?contents=1 to the url to see the list of webparts on page) and delete the error webparts from the page.</p>
<p>In some cases even after deleting the error webpart from the page, the entry is still shown in the database. Not only that the entry is still present, but the entry gets duplicated too. There is nothing to worry though because it might be the case that we have checked out the page, deleted the error webpart but did not check-in the page. Proper check-in of the page should resolve this issue.</p>
<p>Note: If the Test-SPContentDatabase cmdlet shows a missing webpart error, but on the corresponding page if you are not able to find any error webparts, then it means there is a mismatch&nbsp;in the SP 2007 and SP 2010 test environments. Some of the required packages&nbsp;might not have been installed.</p>
<h3>Fixing Orphan Sites:</h3>
<p>It is not often we encounter orphan sites warning, but even if there are no warnings in this category, executing the "stsadm&nbsp; -o databaserepair &ndash;url &lt;webapplicationName&gt; -databasename &lt;DataBaseName&gt;" command and checking for any existense of orphan sites is useful.</p>
<p></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Little more about Test-SPContentDatabase cmdlet</title>
      <link>https://docs.microsoft.com/archive/blogs/subbu/little-more-about-test-spcontentdatabase-cmdlet</link>
      <pubDate>Sat, 19 May 2012 09:18:00 GMT</pubDate>
      <dc:creator><![CDATA[SubrahmanyamK]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/subbu/2012/05/19/little-more-about-test-spcontentdatabase-cmdlet/</guid>
      <description><![CDATA[Test-SPContentDatabase is a powershell cmdlet that is used to test the content database that is...]]></description>
      <content:encoded><![CDATA[<p>Test-SPContentDatabase is a powershell cmdlet that is used to test the content database that is going to be upgraded from SharePoint 2007 to SharePoint 2010.<br />The syntax and details can be found here <a href="https://technet.microsoft.com/en-us/library/ff607941.aspx">https://technet.microsoft.com/en-us/library/ff607941.aspx</a></p>
<p>On a higher level, the Test-SPContentDatabase checks or veririfies the following things:</p>
<ul>
<li>Checking for Missing WebTemplates</li>
<li>Checking for Missing features</li>
<li>Checking for Orphaned sites</li>
<li>Checking for missing setup files</li>
<li>Checking for missing Webparts</li>
<li>Checking for missing Event reveiver assemblies</li>
</ul>
<p>Lets deep dive in to what happens during the checks:</p>
<p><b><span style="text-decoration: underline;">Missing WebTemplates:</span></b></p>
<p>For each of the language packs installed in the farm, the list of webtemplates and sitedefinitions are fetched. Then the fetched templates are compared against the templates present in the content database. The query used to fetch the list of templates present in the content database is:</p>
<p>SELECT Language, WebTemplate, COUNT(1) FROM Webs (NOLOCK) GROUP BY Language, WebTemplate</p>
<p>If there is a mismatch then the corresponding warnings like "Missing SiteDefinition" or "Missing web templates" are thrown. This also verifies for the language packs installed in the farm with the ones present in the content database and shows "Missing Language pack" warning if any.</p>
<p><b><span style="text-decoration: underline;">Missing Features:</span></b><br /><br />In case of missing features the list of features installed in the farm are fetched and compared with the list of features present in the content database. The query used is:</p>
<p>SELECT DISTINCT FeatureId, NULL, NULL, NULL FROM Features (NOLOCK) WHERE FeatureId IS NOT NULL<br />UNION SELECT DISTINCT tp_FeatureId, NULL, NULL, NULL From AllLists (NOLOCK) WHERE tp_FeatureId IS NOT NULL</p>
<p>If there is mismatch in the features listed, the "Missing Feature" warning is shown</p>
<p><b><span style="text-decoration: underline;">Orphaned Sites:</span></b></p>
<p>In case of checking for orphan sites, first the list of all the site collections available in the content database are fetched using the query:</p>
<p>SELECT S.Id, '/' + W.FullUrl, S.HostHeader FROM Webs AS W JOIN Sites AS S ON S.Id = W.SiteId AND W.ParentWebId IS NULL</p>
<p>The list is then compared with data fetched from the configuration database. Basically it tries to find site ids that are not found in the Site map or found in the site map but associated with a different database and also checks if the database contains a site url that is already used by a different site in the same web application. If there is a mismatch, then the orphaned sites warning is shown.</p>
<p><b><span style="text-decoration: underline;">Missing Setup files:</span></b></p>
<p>In case of missing setup files, validation is done to check for any front end files that are referenced in the content database but not installed in the farm. The query used to get the list of setup files is</p>
<p>SELECT SetupPath, COUNT(1) FROM AllDocs (NOLOCK) WHERE SetupPath IS NOT NULL GROUP BY SetupPath ORDER BY SetupPath</p>
<p>If any of the files referenced are found missing in the farm, then the missing setup files warning is shown</p>
<p><b><span style="text-decoration: underline;">Missing Webparts:</span></b></p>
<p>The case of missing webparts is also similar to that of missing features check where the list of webpart type ids referenced in the content database is fetched and compared with the webparts installed in the farm. The query used to find the details is:</p>
<p>SELECT tp_WebPartTypeId, COUNT(1), tp_Assembly, tp_Class FROM AllWebParts (NOLOCK)&nbsp;<br />WHERE tp_WebPartTypeId IS NOT NULL AND tp_SolutionId IS NULL GROUP BY tp_WebPartTypeId, tp_Assembly, tp_Class</p>
<p>If there is a mismatch then the missing webpart warning is shown.</p>
<p><b><span style="text-decoration: underline;">Missing Event Receiver Assemblies:</span></b></p>
<p>The case of event receiver assemblies is also similar to that of missing features where validation is done to find event receiver assemblies that are referenced in the content database but not installed in the farm. The query to know the list of assemblies is:</p>
<p>SELECT DISTINCT Assembly From EventReceivers (NOLOCK) WHERE Assembly IS NOT NULL AND SolutionId IS NULL AND DataLength(Assembly)</p>
<p><b>Note:</b> Ensure that the 'SharePoint 2010' web application against which the Test-SPCOntentDatabase cmdlet is being run has all the required custom solution packages deployed. Usually it may be the case that one forgets to install or deploy the custom solution package that is present in SP 2007 web application which leads to increased count of warnings.</p>
<p><a title="Fixing Test-SPContentDatabase warnings" href="https://blogs.msdn.com/b/subbu/archive/2012/05/20/fixing-test-spcontentdatabase-warnings.aspx" target="_blank">Find here my other post about some details on how to fix the above warnings</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>