【问题标题】:Moving SharePoint subsite to root of site collection using Deployment API使用部署 API 将 SharePoint 子网站移动到网站集的根目录
【发布时间】:2016-11-03 00:18:54
【问题描述】:

我们正在重组我们的 SharePoint 环境,并且我们将把子网站迁移到他们自己的网站集。但是,我们需要在执行此操作时保留对象的 GUID,因此我们将使用 Microsoft.SharePoint.Deployment 选项。

我遇到的麻烦是使用它不允许我将导出的网站导入到新网站集的根目录中。它保留子网路径

例如,如果我导出这样的网络

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

有谁知道如何让它恢复到根目录?我不能使用Import-SPWeb 来执行此操作,因为我需要保留 GUID。

【问题讨论】:

  • 出于好奇,为什么需要保留 GUID?
  • 主要是为了防止我们需要重新创建与列表关联的工作流。试图不需要重新创建它们,它们继续使用SPImport 正常工作。

标签: powershell sharepoint sharepoint-2013


【解决方案1】:

在对此进行进一步研究后,由于我们试图移至其自己的网站集的网站已启用发布,因此无论如何似乎都需要这样做。

https://support.microsoft.com/en-in/kb/968483

Microsoft Office SharePoint Server 2007/2010/2013 不支持 子站点迁移到根站点或根站点迁移到子站点 已开启发布功能的网站集。

我猜部署 API 考虑到了这个限制。

作为参考,这是我们需要遵循的解决方案。

使用发布功能时的有效迁移方案是 以下:

  • 从根网站开始导出网站集,然后将其作为根网站导入新网站集
  • 导出网站集的子网站,然后将它们作为子网站导入具有发布功能的现有网站集中 启用的功能

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-15
    • 1970-01-01
    • 2010-12-06
    • 1970-01-01
    • 2014-06-16
    • 2010-11-23
    • 1970-01-01
    相关资源
    最近更新 更多