我们正在重构我们的SharePoint环境并拥有子网站,我们将迁移到他们自己的网站集。但是,我们需要保留对象的GUID,因此我们将使用Microsoft.SharePoint.Deployment
选项。使用部署API将SharePoint子网站移动到网站集的根目录
我遇到的麻烦是使用它不会允许我将导出的网站导入新网站集的根目录。如果我出口网络,如本
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/
,但是这个恢复到http://sharepoint.domain.com/sites/site2/example
有谁知道h ow得到这个恢复到根?我不能使用Import-SPWeb
来做到这一点,因为我需要保留GUID。
出于好奇,为什么你需要保留GUID? – Thriggle
主要是为了防止我们需要重新创建与列表关联的工作流程。试图不需要重新创建它们,它们继续使用'SPImport'正常运行。 – Kirk