Preupgradecheck errors – part 3


 Missing Site definitions

The following site definition(s) are referenced by the content, but they are not installed on the web server

name = Unknown, language = 1036, template id = 53, count = 1, status = Missing            
name = Unknown, language = 3082, template id = 53, count = 2, status = Missing            

Solution :

  1. Run stsadm –o enumallwebs
  2. In the output of enumallwebs and search for templateid=”53” or template name=unknown

                For example:

                <Web Id=”c81bceb5-9e18-45b0-a42a-76887316daa9″ Url=”/sites/baseline/Gregg”       LanguageId=”1036″ TemplateName=”Unknown” TemplateId=”53″ />

<Web Id=”e8268465-b11b-431c-ad1c-d868ae9fc8ee” Url=”/sites/baseline/test hcl” LanguageId=”3082″ TemplateName=”Unknown” TemplateId=”53″ />

    Once you have the webids , remove these orphan webs using deleteweb command :

stsadm -o deleteweb -webid  “e8268465-b11b-431c-ad1c-d868ae9fc8ee” -force -databasename MyWork_WSS_Content_CPGPortal_01 -databaseserver ausb3spsdbp01

Advertisements

August 2011 Cumulative Updates


 August 2011 Cumulative Updates  for SharePoint 2007/2010

 
Please note that  SharePoint Server 2010 CU contains the SharePoint Foundation CU. And the SharePoint Server 2010 with Project Server CU contains Project Server CU, SharePoint Server CU and SharePoint Foundation CU.
That means only one package has to be installed for the SharePoint 2010 product family. 
 
 

Preupgradecheck errors -Part -1


Missing server file or server configuration issues.
Web part Errors:
The following web part(s) are referenced by the content, but they are not installed on the web server

•Id = 72818beb-d38f-ce20-ad03-17a569674760, Type = Unknown, Reference = 29, Status = Missing             
•Id = b0361b90-8e73-425f-bcbc-2b2469198a00, Type = Unknown, Reference = 14, Status = Missing             
•Id = 19060b95-1c73-5a5b-875c-2e2c7d7cd355, Type = Unknown, Reference = 4, Status = Missing             

Steps to fix the errors
1.Logon to Database server and Run following SQL query on the content database for the Support site:

SELECT * FROM [WebParts] WITH(NOLOCK)where tp_WebPartTypeId =’ID’             
Example: SELECT * FROM [WebParts] WITH(NOLOCK)where tp_WebPartTypeId ='72818beb-d38f-ce20-ad03-17a569674760'             
            

From the results pane copy the tp_PageUrlID . These are the ids of the urls which has reference to the missing webparts .

2.Now run following query:

SELECT * FROM Alldocs WITH(NOLOCK)where id='80A251DD-1452-4199-A0BA-05120A7286EC'            

(ID is the value of the tp_PageURLID)

You will get DirName and LeafName corresponding to that PageURLID

3.Repeat step-2 for all the PageURL Ids to get complete URLs for a particular webpart ID. Step-1 and Step-2 needs to be performed multiple times to get a list of all the URLs where we need to fix the webpart error.
4.Now go to the URL, example :http://abc.amd.com/test/pages/test.aspx?contents=1
5.Check-out the page , delete the error web part and check-in/publish the page
6.To test if the issue is fixed run the below query again:

SELECT * FROM Alldocs WITH(NOLOCK)where id='80A251DD-1452-4199-A0BA-05120A7286EC'

again.

You should not get any results if all the URLs are fixed.

How to determine which MOSS sites/subsites are not used anymore?


For most of the SharePoint Admins this is a Challenge as analyzing usage logs if you have 1000+sites is almost impossible plus it gives data for only 30 days. What if we need to delete the sites which are not accessed by anyone in last 6 months/1 year?
Site auto deletion feature may not be feasible for everyone.

Below are some methods which can be utilized to solve the purpose

1. 1st Method- MSIT SharePoint Reporting Framework – This tool can be used to check last content modified date and other useful infomation to the site admins . Tool is available at codeplex-http://msitsrf.codeplex.com/ . But this should not be used on production database and the content database should be coiped to test farm if you need to execute the queries.

2. 2nd method- If your requiremnt is to get the last accessed date and you are not bothered if the content is modified recently or not then “Daylastaccessed” column in dbo.Webs is what you are looking for.

Daylastaccessed – column gives value that specifies the last day the site was accessed, which is expressed as the number of days since January 1, 1899 until the last day the site was accessed.
This column is currently used by the usage processing code, but it can also be used in ad-hoc queries to check which sites have been used most recently and which have been used least recently. For example, Select FullUrl,DayLastAccessed From Webs Order By DayLastAccessed.
Sites that have never been used or that have never had their usage data processed for some reason will have this field set to 0.

Use following sql query to extract the information from the content database. This query also converts the smallint type to datetime and gives exactly what you need :

SELECT FullUrl AS ‘Site URL’, TimeCreated, DATEADD(d,DayLastAccessed + 65536,
CONVERT(datetime, ‘1/1/1899’, 101)) AS
lastAccessDate
FROM [DATABSE_NAME].dbo.Webs
WHERE (DayLastAccessed 0)

Powershell Script to enable/disable Blob Caching on SharePoint 2010 Farm


# Enable-SPBlobCache Function            
function Enable-SPBlobCache {             
param(             
                [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]            
                [Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]             
                $WebApplication,            
                [Parameter(Mandatory=$false, ValueFromPipeline=$true, Position=1)]            
                $BlobCacheLocation="E:\BlobCache\"            
)             
            
process {             
    $WebApp = $WebApplication.Read()             
    # SPWebConfigModification to enable BlobCache             
    $configMod1 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification             
    $configMod1.Path = "configuration/SharePoint/BlobCache"             
    $configMod1.Name = "enabled"             
    $configMod1.Sequence = 0             
    $configMod1.Owner = "BlobCacheMod"             
    ## SPWebConfigModificationType.EnsureChildNode -> 0             
    ## SPWebConfigModificationType.EnsureAttribute -> 1             
    ## SPWebConfigModificationType.EnsureSection -> 2             
    $configMod1.Type = 1             
    $configMod1.Value = "true"            
                                            
    ######################################################################            
                            
                # SPWebConfigModification to enable client-side Blob caching (max-age)             
    $configMod2 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification             
    $configMod2.Path = "configuration/SharePoint/BlobCache"             
    $configMod2.Name = "max-age"             
    $configMod2.Sequence = 0             
    $configMod2.Owner = "BlobCacheMod"             
    ## SPWebConfigModificationType.EnsureChildNode -> 0             
    ## SPWebConfigModificationType.EnsureAttribute -> 1             
    ## SPWebConfigModificationType.EnsureSection -> 2             
    $configMod2.Type = 1             
    $configMod2.Value = "86400"             
                            
                ######################################################################            
                            
                # SPWebConfigModification to change the default location for the Blob Cache files            
                $configMod3 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification            
                $configMod3.Path = "configuration/SharePoint/BlobCache"            
                $configMod3.Name = "location"            
                $configMod3.Sequence = "0"            
                $configMod3.Owner = "BlobCacheMod"            
                ## SPWebConfigModificationType.EnsureChildNode -> 0             
    ## SPWebConfigModificationType.EnsureAttribute -> 1             
    ## SPWebConfigModificationType.EnsureSection -> 2             
                $configMod3.Type = 1            
                $configMod3.Value = $BlobCacheLocation            
    # Add mods, update, and apply             
    $WebApp.WebConfigModifications.Add( $configMod1 )             
    $WebApp.WebConfigModifications.Add( $configMod2 )            
                $WebApp.WebConfigModifications.Add( $configMod3 )            
    $WebApp.Update()             
    $WebApp.Parent.ApplyWebConfigModifications()             
}             
}            
            
            
            
# Disable-SPBlobCache Function            
function Disable-SPBlobCache {             
param(             
    [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]             
    [Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]             
    $WebApplication             
)             
            
process {             
    $WebApp = $WebApplication.Read()             
    $mods = @()             
    foreach ( $mod in $WebApp.WebConfigModifications ) {             
        if ( $mod.Owner -eq "BlobCacheMod" ) {             
            $mods += $mod             
        }             
}             
    foreach ( $mod in $mods ) {             
        [void] $WebApp.WebConfigModifications.Remove( $mod )             
    }             
    $WebApp.Update()             
    $WebApp.Parent.ApplyWebConfigModifications()             
}             
}            

Working of the Script:

  1. Copy Blobcache.ps1 to local drive on Sharepoint server or on a file share
  2. This script is using Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind  class of Microsoft.SharePoint.PowerShell assembly so we need to make sure we add the reference in PS by running command

Add-PSSnapin Microsoft.SharePoint.PowerShell

  1. Set the executionpolicy to unrestricted
  2. Run the script (Dot source it) – type a period and a blank space and then type the path to the script file (see the screenshot)
  3. Execute Enable-SPblobcache function to enable blobcaching, supply the webapplication name on the prompt
  4. To disable execute Disable-SPblobcache

**Location of Blobcache folder, max age etc can be changed from the script itself.

** If you enable blob caching using Enable-SPblobcache function then be sure to disable it using Disable-SPblobcache function (dont do it manually).