PowerShell allows you to use multiple mapping files for migrating your objects or content.
Follow this example script:
# 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 whole mapping settings $mappingSettings
You can now use the $mappingSettings object in your copy command. The important thing to note is that each cmdlet that generates a mapping settings object has a switch called '-MappingSettings' which allows adding mapping settings to an existing mapping settings object.
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite" $dstSite = Connect-Site -Url "http://myfarm2/sites/mydestinationsite" $result = Copy-Site -Site $srcSite -DestinationSite $dstSite -Merge -MappingSettings $mappingSettings $result Export-Report $result -Path "C:\MyReports\CopySiteReports.xlsx"
Comments
0 comments
Please sign in to leave a comment.