メインコンテンツにスキップ

複数のマッピング ファイルを同時に使用する

注: PowerShell 統合には、ShareGate Migrate の Pro または Enterprise サブスクリプションが必要です。Essentials プランでは利用できません。

PowerShell では、オブジェクトやコンテンツを移行する際に複数のマッピング ファイルを使用できます。

# Import a Content Type Mapping to a new Mapping Settings
$mappingSettings = Import-ContentTypeMapping -Path "C:\MyMappings\ContentTypeMappings.sgctm"

# Add a Property Mapping
$mappingSettings = Import-PropertyMapping -Path "C:\MyMappings\PropertyMappings.sgpm" -MappingSettings $mappingSettings

# Add a Permission Level Mapping
$mappingSettings = Import-PermissionLevelMapping -Path "C:\MyMappings\PermissionLevelMappings.sgrm" -MappingSettings $mappingSettings

# Add a User and Group Mapping
$mappingSettings = Import-UserAndGroupMapping -Path "C:\MyMappings\UserAndGroupMappings.sgum" -MappingSettings $mappingSettings

# Display the entire mapping settings
$mappingSettings

これで、コピー コマンドで $mappingSettings オブジェクトを使用できます。重要な点として、マッピング設定オブジェクトを生成する各コマンドレットには -MappingSettings というスイッチがあり、これを使用して既存のマッピング設定オブジェクトにマッピング設定を追加できます。

# Connect to the source site
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"

# Connect to the destination site
$dstSite = Connect-Site -Url "http://myfarm2/sites/mydestinationsite"

# Copy the source site to the destination site using mapping settings and merge option
$result = Copy-Site -Site $srcSite -DestinationSite $dstSite -Merge -MappingSettings $mappingSettings

# Display the result
$result

# Export the report to an Excel file
Export-Report $result -Path "C:\MyReports\CopySiteReports.xlsx"

詳細については、New Mapping Settingsを参照してください。

ヒント: 結果をウィンドウに出力するか、移行レポートを Excel ファイルにエクスポートします。詳細については、Export-Reportを参照してください。

この記事はAIによって翻訳されています。ご不明な点がある場合は、英語の原文をご確認ください。

こちらの回答で解決しましたか?