Move SharePoint sites to a new location - Site Swap
Microsoft introduced with the SharePoint Online Management Shell version 16.0.8812.1200 the capability to swap SharePoint Online root site or /search site in your tenant.
Ensure that you have the latest version of the SharePoint Online Management Shell. The next code snippet shows how you could run the command.
The script above will take the source site and store it either in the root site or /search site of your tenant. The previous site in that location will be archived to the archive URL your are specifying. This allows you to rollback your changes if required.
- The target site may return a not found (HTTP 404) error for a short period of time (up to about 5 minutes)
- Content will need to be recrawled to update the search index for the sites that have been swapped. This may take a period of time depending on various factors such as the amount of content in these sites. Anything dependent on the search index, may return incomplete results until the swapped sites have been recrawled.
- Anything dependent on static links (such as File Sync and OneNote files) will need to be manually corrected.