How To: SharePoint Site Swap
New PowerShell cmdlet that is rolling out to organizations now and is expected to be rolled out globally by the end of October 2019. This cmdlet will allow SharePoint admins to swap the root url of their SharePoint site with a different site. In this how to we are going to swap a site to the root url of SharePoint Online.
Requirements:
- SharePoint Admin PowerShell 16.0.8812.100 or later
- Open PowerShell and connect to your tenant
Connect-SPOService -Url https://YOURTENANT-admin.sharepoint.com
We need to run the Invoke-SPOSiteSwap cmdlet with the below parameters.
- SourceUrl: Location of the site you want move. (Must exist before)
- TargetUrl: Location where you want your site to go. (Must exist before)
- ArchiveUrl: Location where the site currently at the targetUrl will move to. (Must NOT exist before)
2. Run the command!
Invoke-SPOSiteSwap -SourceUrl https://devroberts.sharepoint.com/sites/test1 -TargetUrl https://devroberts.sharepoint.com -ArchiveUrl https://devroberts.sharepoint.com/sites/Archive
If the command ran successfully the root of your SharePoint site will now be your source site!