error replacing SharePoint root site
Valentin Komarovskiy, MBA
Solving complex business problems and alleviating technical pain points to improve efficiency and reduce risks.
I recently worked with Microsoft support and SharePoint Online product teams to troubleshoot and resolve a bug in the SharePoint Online performance plug-in and a new version was published on July 1, 2024. The updated tool is available as a plug-in for Chrome and Edge, the download links are below. The bug was blocking replacement of the SharePoint root site with the following error:
Page content like images, video, and text are impacting page performance. Reduce the number of web parts, use Content Delivery Networks (CDNs), and limit page content. Learn more
Here is a tutorial how to fix the issue and replace root site
In SharePoint Online, there are specific guidelines and limitations regarding the use of web parts on a page to ensure optimal performance and user experience:
Number of Web Parts:
It is recommended to use no more than 20 web parts per page. This includes both out-of-the-box (OOTB) Microsoft web parts and custom web parts
For dynamic web parts that fetch data, such as the News web part, it is advisable to limit to 4 dynamic web parts per page
Performance Considerations:
Excessive web parts and features can impact page load times and overall performance. To mitigate this, optimize web part scripts, reduce dependencies, and implement client-side caching.
Lazy loading can be employed to defer the loading of non-critical web parts, improving the initial page load performance
Optimize site performance
Explanation: Web parts are modular units of content, such as text, images, videos, and other interactive elements on a web page. Having too many web parts can slow down the page load time.
领英推荐
Using Content Delivery Networks (CDNs)
A CDN is a network of servers distributed across various locations. CDNs store copies of your web content and deliver it to users from the server closest to their geographic location, reducing load times and improving performance. Once you enable CDN on your SharePoint tenant the Microsoft CDN will be used.
How to enable SharePoint SDN using PowerShell, you will need to install SharePoint Online PowerShell module first
you can check if SDN is enabled using SharePoint Online Powershell module and set it as well:
Get-PnPTenantCdnEnabled -CdnType Public
Get-PnPTenantCdnEnabled -CdnType Private
Set-PnPTenantCdnEnabled -CdnType Public -Enable $true
Set-PnPTenantCdnEnabled -CdnType Private -Enable $true
After the new Root Site is optimized, scan using Page diagnostics for SharePoint
To replace the site using GUI, navigate to the current root site. Disable Hub and Disable custom scripts. Click on "replace root site" and specify the site you want to replace with.
How to replace the root SharePoint site using PowerShell
#Set Parameters
$AdminCenterURL="https://mytenant-admin.sharepoint.com"
$SourceSiteURL = "https://mytenant.sharepoint.com/sites/new" #Newly built intranet
$TargetSiteURL = "https://mytenant.sharepoint.com/existing" #Existing Intranet Site URL - SharePoint Root site
$ArchiveSiteURL = "https://mytenant.sharepoint.com/sites/archivehome" #Backup for existing Intranet
#Connect to SharePoint Online
Connect-SPOService -Url $AdminCenterURL
#Start Site Swap
Invoke-SPOSiteSwap -SourceUrl $SourceSiteURL -TargetUrl $TargetSiteURL -ArchiveUrl $ArchiveSiteURL