Wednesday, October 23, 2013

The site is not valid. The 'Pages' document library is missing. - SharePoint 2010

Recently I was involved in upgrading SharePoint sites from MOSS 2007 SharePoint 2010. After upgrade found that user is not able to create new pages in Page library of publishing sites. But this issue was not present in MOSS 2007. Below is the details on how I resolved the issue.

Issue Description :
I try to create new page in Pages library and it throw an error message with correlation id. Then I looked into log file and below error was associated with correlation id.

Microsoft.SharePoint.Publishing.InvalidPublishingWebException: The site is not valid. The 'Pages' document library is missing.

Root Cause :
 - Publishing Feature is not activated
 - The value stored in "__PageListId" property bag is not same as the actual page library list id

Solution :
 - Make sure publishing feature is active
 - Try to de-activate and re-activate the publishing feature if you see the publishing feature is showing active
 - Run the following PowerShell script to fix the inconsistency of the actual Pages library and try to de-activate and re-activate the publishing feature again.

$web = get-spweb "Affected Site URL"
$correctId = $web.Lists["Pages"].ID
$web.AllProperties["__PagesListId"] = $correctId.ToString()

Please validate and enjoy !!!

Please post your feedback or queries related to this.

Sunday, October 6, 2013

Restoring Workflow to Previous Version in SharePoint

Hi All,

Please follow the below steps to restore the previous version of workflow in SharePoint.

1.Open sharepoint designer with the site url where the wirkflow is resided.
2.Goto all files on workflows the required workflow will find the workflowname.XOML file
6.Right click on it -->Version History
7.Select the version you want restore
8.Restore it
9.Do the Same for xoml.wfconfig.xml
10.Then publish the workflow

Hope this helps !