error replacing SharePoint root site

error replacing SharePoint root site


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.

  • Consolidate Content: Combine multiple web parts into fewer, more comprehensive ones. Remove any images that are larger than 500kb, you can add them back later, after the rot site is replaced
  • Compare Site Features: check enabled features of the old and new site side-by-side, make sure they are identical
  • Remove Unnecessary Elements: Eliminate any web parts that do not add significant value to the user experience.

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

  1. Install the Page Diagnostics Tool Browser Extension: The tool is available as a browser extension for Microsoft Edge and Google Chrome. Install it from the respective web store. For Edge: Page Diagnostics for SharePoint - Microsoft Edge Addons
  2. For Chrome: Page Diagnostics for SharePoint - Chrome Web Store
  3. Access the SharePoint Page you are replacing and the replacement site in turn Navigate to the SharePoint Online page you want to analyze. Ensure you are logged in with sufficient permissions to view the page content.
  4. Open the Page Diagnostics Tool Click on the Page Diagnostics tool icon in your browser’s toolbar to open the tool.
  5. Run the Analysis With the SharePoint page open, click the "Start" button in the Page Diagnostics tool. The tool will begin analyzing the page.
  6. Review the Results After the analysis is complete, the tool will display the results, including: Performance Metrics: Load time, server response time, and page weight. Issues and Recommendations: Identified performance issues and recommendations for optimization. Traffic Light Ratings: Visual indicators (green, yellow, red) to show the severity of issues.
  7. Follow the Recommendations Implement the suggested optimizations to improve page performance. Common recommendations may include: Reducing the number of web parts. Optimizing images and other media. Minimizing the use of custom scripts and styles. Using Content Delivery Networks (CDNs) for static assets.

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        

要查看或添加评论,请登录

社区洞察

其他会员也浏览了