Swapping a classic root site with a modern subsite in SharePoint Online involves several steps, and it's essential to be cautious as it can impact the structure and content of your SharePoint environment. Below are high-level steps to achieve this using SharePoint Online Management Shell (PowerShell).
Create a Modern Site:
➢ Create a new modern site where you want your root site to be.
➢ You can create a communication site or a team site, depending on your needs. Migrate Content:
➢ Manually migrate content from the classic root site to the new modern site. This could include documents, lists, libraries, pages, etc.
➢ You might use the SharePoint Online migration tools or third-party tools if your content is extensive. Update Navigation:
➢ If you had a specific navigation structure in the classic site, replicate it in the modern site.
➢ Modern sites use Hub sites, which allow you to associate multiple sites, so you might consider organizing your sites in a hub if applicable.
Set Permissions:
➢ Ensure that permissions are set up correctly in the new modern site to match those of the classic root site.
➢ Update Links and References:
➢ If there were links pointing to the classic root site, update them to point to the new modern site.
Test and Validate:
➢ Test all functionalities, including navigation, permissions, and customizations, to make sure everything works as expected. Inform Users:
➢ Notify users of the change and provide any necessary training if the user interface or features have significantly changed. Configure Redirects (if needed): ➢ If there are external links or bookmarks pointing directly to the classic root site, consider setting up redirects or informing users to update their bookmarks. Backup Classic Site (Optional):
➢ Before making any changes, consider creating a backup of your classic root site. SharePoint Online has features like site collection backups that can be used for this purpose
➢ Make sure you have SharePoint Online Management Shell installed on your machine. You can download and install it from the Microsoft website.
➢ Open SharePoint Online Management Shell and connect to your SharePoint Online environment using the following commands:
In the steps below we are assuming the following: You have a classic root site collection at https://yourSP.sharepoint.com
You have a modern Communication Site already created in your tenant (https://yourSP.sharepoint.com/sites/NewModernSite)
###Set Parameters
$AdminCenterURL= “https:// youradmin-admin.sharepoint.com”
$SourceSiteURL = “https://yourSP.sharepoint.com/sites/NewModernSite”
###Newly built intranet
$TargetSiteURL =“https://yourSP.sharepoint.com”
####Existing Intranet Site URL (SharePoint Root site)
$ArchiveSiteURL =“https://yourSP.sharepoint.com/sites/OriginalRootSite” ####Backup for existing Intranet
Connect to SharePoint Online:
Connect-SPOService -Url $AdminCenterURL -Credential
(Get-Credential)
Script to Start Site Swap:
Invoke-SPOSiteSwap -SourceUrl $SourceSiteURL - TargetUrl $TargetSiteURL -ArchiveUrl $ArchiveSiteURL
Important Notes:
Always backup your SharePoint environment before making significant changes.
Make sure to test these scripts in a non-production environment first.
Ensure that you have the necessary permissions to perform these actions.
Comments