Moving a publishing site from one site collection to another site collection
-
Saturday, May 05, 2012 12:59 AM
I am in the process of moving Publication sites from 8 Different Site collections to 1 Site collection. I have copied the page layouts from the source to target. I have reset the pagelayout to point to the correct layout. I still get the dreaded Page Layout error. The ULS is logging the following error.
PageSettingsPage.LoadValues: a exception is thrown when calling PublishingPage.IsTemplatedPage, exception = System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ComputeRedirectionVirtualPath(TemplateRedirectionPage basePage)
at Microsoft.SharePoint.Publishing.Internal.CmsVirtualPathProvider.CombineVirtualPaths(String basePath, String relativePath)
at System.Web.Hosting.VirtualPathProvider.CombineVirtualPaths(VirtualPath basePath, VirtualPath relativePath)
at System.Web.UI.DependencyParser.AddDependency(VirtualPath virtualPath)
at System.Web.UI.DependencyParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.PageDependencyParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.DependencyParser.ParseString(String text)
at System.Web.UI.DependencyParser.ParseFile(String physicalPath, VirtualPath virtualPath)
at System.Web.UI.DependencyParser.GetVirtualPathDependencies()
at Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.CalculateFileDependencies(HttpContext context, SPRequestModuleData basicRequestData, ICollection& directDependencies, ICollection& childDependencies)
at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureDependencies(HttpContext context, SPRequestModuleData requestData)
at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureCacheKeyAndViewStateHash(HttpContext context, SPRequestModuleData requestData)
at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.GetVirtualPathProviderCacheKey(HttpContext context, SPRequestModuleData requestData)
at Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.GetCacheKey(String virtualPath)
at Microsoft.SharePoint.Publishing.Internal.CmsVirtualPathProvider.GetCacheKey(String virtualPath)
at System.Web.Compilation.BuildManager.GetCacheKeyFromVirtualPath(VirtualPath virtualPath, Boolean& keyFromVPP)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(String virtualPath, Type requiredBaseType)
at Microsoft.SharePoint.Publishing.PublishingPage.get_IsTemplatedPage()
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.PageSettingsPage.LoadLayoutValues()I have verified in the Content and structure default.aspx does show the correct page layout in the new location. I have verifies the layout page is reachable. (I can click and it displays the page.)
The first Site moved properly. I am stuck on everything else.
The steps I follow are
1. Bring the payouts page to local Drive.
2. upload it to the taget site collection.
3. Export-spweb
4. Import-spweb
5. Update the page layout with Powershell
$spWeb = Get-SPWeb(http://server/web)
$spFile = $spWeb.GetFile("http://server/web/Pages/Default.aspx")
$spFile.CheckOut("Online",$null)
$spFile.Properties["PublishingPagelayout"] = "/_catalogs/masterpage/Technology.aspx, Technology"
$spFile.Update()
$spFile.CheckIn("Update page layout via PowerShell",[Microsoft.SharePoint.SPCheckinType]::MajorCheckIn)
$spWeb.Dispose()Any insights?
Thanks in Advance.
Nagesh
Days and years do not mean anything to me. Moments shared are frozen
in their time frame. Distance or time never fades them for me. I cherish them
like my life. I have never let them sleep alone. Sachi- Edited by Nagesh S Saturday, May 05, 2012 12:59 AM
All Replies
-
Saturday, May 05, 2012 1:45 AM
Forther information on this.
For the Offending Publishing sites even moving them within the same site collection causes this.
Error
This page is not using a valid page layout. To correct the problem, edit page settings and select a valid page layout.
I did an export-spweb and did an import back as a subsite of the source.
Thanks in Advance.
HTH
Nagesh S
Days and years do not mean anything to me. Moments shared are frozen
in their time frame. Distance or time never fades them for me. I cherish them
like my life. I have never let them sleep alone. Sachi

