There are different copy options you can apply in your PowerShell script.
- Content migration
- Structure migration
- Operation mode
- Insane mode and Normal mode
Configuration and filter options
When migrating with the Copy-Site or Copy-List commands, the application will try to replicate your source by default. To modify the configuration (permissions, workflows, etc.), you have to dismiss the elements you do not wish to preserve on your copy line with a switch parameter:
Migrating a site with no custom permissions, no content, and no workflows:
$srcSite = Connect-Site -Url http://myfarm1/sites/mysourcesite $dstSite = Connect-Site -Url http://myfarm1/sites/mydestinationsite Copy-Site -Site $srcSite -DestinationSite $dstSite -Merge -NoCustomPermissions -NoContent -NoWorkflows
Note: There are two exceptions to this. You have to add -UserAlerts and -Subsites if you wish to keep user alerts and subsites.
To limit the number of versions, you can add -VersionLimit followed by the number of versions you wish to keep.
To force lists to use the modern experience, you can add -ForceNewListExperience.
It is not possible to change Dependencies with PowerShell.
If the hierarchy of your sites matches between the source and the destination, Mirror is used.
If the hierarchy does not match, the app will copy the dependencies to the site at the destination.
Insane mode and Normal mode
Your script will use Insane mode by default. You can overwrite the setting by adding -NormalMode to your copy line.