SharePoint環境を再構築しており、自分のサイトコレクションに移行するサブサイトがあります。ただし、オブジェクトのGUIDを保持する必要があるため、Microsoft.SharePoint.Deployment
オプションを使用します。展開APIを使用してSharePointサブサイトをサイトコレクションのルートに移動
私が実行している問題は、これを使用すると、エクスポートされたWebを新しいサイトコレクションのルートにインポートできないということです。私はそのようなこの
Export-SPWeb "http://sharepoint.domain.com/sites/site1/example" -Path c:\export\example.cmp
としてウェブをエクスポートする以下のスクリプトでそれをインポートする場合は、サブWebのパスたとえば
を保つ
$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ルートWebとしてhttp://sharepoint.domain.com/sites/site2/
に復元されますが、復元するとhttp://sharepoint.domain.com/sites/site2/example
誰でも知っていますか?これを根に復元するにはどうすればいいですか?私はGUIDを保持する必要があるので、これを行うにはImport-SPWeb
を使用できません。
好奇心で、なぜGUIDを保持する必要がありますか? – Thriggle
ほとんどの場合、リストに関連付けられたワークフローを再作成する必要がありません。それらをすべて再作成する必要がないので、彼らは 'SPImport'を使ってうまく機能し続けます。 – Kirk