我们正在重组我们的SharePoint环境,并且有我们将迁移到他们自己的站点集合的子站点。但是,在这样做时,我们需要保留对象的GUID,因此我们将使用Microsoft.SharePoint.Deployment选项。
我遇到的麻烦是,使用它将不允许我将导出的web导入到新站点集合的根中。它保持子网路径。
例如,如果我导出这样的web
Export-SPWeb "http://sharepoint.domain.com/sites/site1/example" -Path c:\export\example.cmp然后用以下脚本导入它
$siteURL = "http://sharepoint.domain.com/sites/site2/"
$fileLocation = "c:\export"
$fileName = "example.cmp"
[void][System.Reflection.Assembly]::load("Microsoft.Sharepoint, version=12.0.0.0, culture=neutral, publickeytoken=71e9bce111e9429c")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Deployment")
# settings
$settings = new-object Microsoft.SharePoint.Deployment.SPImportSettings
$settings.SiteUrl = $siteURL
$settings.WebUrl = $siteURL
$settings.FileLocation = $fileLocation
$settings.FileCompression = $true
$settings.RetainObjectIdentity = $true
$settings.UserInfoDateTime = [Microsoft.SharePoint.Deployment.SPImportUserInfoDateTimeOption]::ImportAll
$settings.BaseFileName = $fileName
$import = new-object Microsoft.SharePoint.Deployment.SPImport($settings)
$import.Run()其意图是example.cmp将恢复为http://sharepoint.domain.com/sites/site2/作为根web,但是这将恢复到http://sharepoint.domain.com/sites/site2/example。
有人知道如何使这个恢复到根部吗?我不能使用Import-SPWeb来完成这个任务,因为我需要保存GUID。
发布于 2016-07-26 16:23:26
在对此做了进一步的研究之后,由于我们试图转移到自己的站点集合已经启用了发布,它似乎需要这样做无论如何。
https://support.microsoft.com/en-in/kb/968483
2007/2010/2013不支持将子站点迁移到根站点,也不支持将SharePoint站点迁移到打开发布功能的站点集合中的子站点。
我猜想Deployment正在使用这个限制。
作为参考,这是我们需要遵循的决议。
使用发布功能时的有效迁移场景如下:
https://stackoverflow.com/questions/38130966
复制相似问题