SharePoint Online: How to Replace a Classic Root Site Collection with a Modern Site?

Requirement: Convert SharePoint Online Root site collection from a classic to a modern site! Our requirement is, We have built a new Intranet based on a Modern SharePoint Communication site and want to replace it with the root site.

How to change the root site from a classic to a modern experience?

As the SharePoint Online root site collection is created as a classic experience site by default, we had no options to migrate from classic to modern (and we can’t delete and re-create the root site!). Well, not anymore! We can replace it with another modern site either from the Admin center or using Invoke-SPOSiteSwap cmdlet. The newly introduced Invoke-SPOSiteSwap cmdlet can be used to migrate the SharePoint Online site from classic to modern. In this guide, we will show you how to change a classic SharePoint Online root site to a modern communication site.

sharepoint online change root site to modern

How to replace a Classic Root Site with a Modern Communication Site in SharePoint Online?

Replacing a classic root site collection with a modern site in SharePoint Online is a great way to ensure that users can access the most current features of SharePoint Online and stay organized and productive, as the company Intranet will be the default landing page in most organizations.

Here is how the process of changing the root site in SharePoint Online works:

  1. Login to SharePoint Admin Center >> Expand Sites and then Active Sites.
  2. Create a new communication site or modern Team site without Office 365 group. E.g.,
  3. Now, from the sites list, select the existing root site, and click on the “Replace site” button in the toolbar.
    replace classic root site with modern communication site
  4. Provide the existing site you’ve created and hit “Save”.

This will replace the root site with the new site you’ve entered. The existing root site will also be saved as an archive.

If you get “This site is on hold.” message, You got to remove the root site from the retention policy! Also, The site must not be a SharePoint Home site (SharePoint start page) or Hub Site! How to Remove a site from the Retention Policy in Sharepoint Online?

Convert Classic Root Site Collection to Modern site using PowerShell:

Replacing root site with a new modern site is just a two-step process. Make sure you have the latest PowerShell module for SharePoint Online installed (16.0.8812.1200 or later). To get the installed PowerShell module version, use the following:

(Get-Module -Name Microsoft.Online.SharePoint.PowerShell).Version.ToString()  

Step 1: Create a new modern SharePoint site collection using a communication site template and customize it as per your requirements, such as adding necessary resources like document libraries, navigation, etc. You can also use any existing modern communication site in your SharePoint environment. This will be your new top-level site.

Step 2: Execute the Invoke-SiteSwap cmdlet to start replacing the old site with the new One
Here is the SharePoint Online PowerShell script to swap a new SharePoint site in place of the old site collection. As its name suggests, the Invoke-SPOSiteSwap PowerShell command swaps a site collection with another one, while taking a backup of the source site collection. Also, it creates a site redirect from the source location to the target location (unless you disable it with -DisableRedirection switch!).

#Set Parameters
$SourceSiteURL = "" #Newly built intranet
$TargetSiteURL = "" #Existing Intranet Site URL - SharePoint Root site
$ArchiveSiteURL = "" #Backup for existing Intranet

#Connect to SharePoint Online
Connect-SPOService -Url $AdminCenterURL -Credential (Get-Credential)

#Start Site Swap
Invoke-SPOSiteSwap -SourceUrl $SourceSiteURL -TargetUrl $TargetSiteURL -ArchiveUrl $ArchiveSiteURL

The Root site swap process may take a moment to complete. Please note that the source and target sites can’t connect to an Office 365 group. They also can’t be hub sites or associated with a hub (Remove the Hub site association before swapping and re-associate). Typically, it takes a few minutes to complete. All subsites contained with the source and target sites will be swapped, and this cmdlet takes the following parameters:

  • SourceURL – New site collection that you want to swap with your old site. The source site must be an existing classic team site (STS#0), Modern Team Site (STS#3), or Communication Site (SITEPAGEPUBLISHING#0)
  • TargetURL – This is your existing Classic site in the Office 365 tenant.
  • ArchiveURL – Archival URL is the location to archive an existing site. It must not currently exist (even as a deleted site in Recycle bin). This allows you to roll back your changes if required.

The Invoke-SPOSiteSwap cmdlet doesn’t convert your classic site collection into a modern one. Instead, it replaces the current site collection with another existing one! Moreover, any static link must be fixed manually.

change root site in sharepoint online


In conclusion, replacing the classic root site collection with a modern site in SharePoint Online can be accomplished using either SharePoint Admin Center or PowerShell. This process can be useful when you’re looking to modernize your SharePoint Online environment and take advantage of the new features and functionalities available on modern sites. Overall, replacing the classic root site collection with a modern communication site that offers a modern user interface that is more visually appealing, Mobile-Friendly, advanced web parts, and intuitive, responsive user experience helps to increase productivity and collaboration.

You can also change the site template of your base URL in SharePoint Online from classic to communication site as in SharePoint Online: Convert Classic Team Site to Communication Site

How do you create a new root site in SharePoint online?

Your Root site will be created when you provision your Microsoft 365 tenant. You can’t delete and re-create the Tenant Root site. Instead, use the Site swap method explained in this article!

How do I create a classic page in SharePoint Online?

To create a classic page in SharePoint Online, we can navigate to the Site Pages library and click on New. Then we can select the Web Part Page option to create a classic page. More info: How to Create a Classic Web Part Page in SharePoint Online?

How do I turn off the classic view in SharePoint Online?

To remove the “Return to Classic SharePoint” link in SharePoint Online, we can use PowerShell to disable the link at the tenant level with Set-SPOTenant cmdlet with the parameter -DisableBackToClassic $True to disable the link. This will remove the “Return to Classic SharePoint” link for all sites across the tenant. You can also set the List experience in SharePoint Lists and Libraries to use the modern experience.
More info: How to turn off classic view in SharePoint?

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

One thought on “SharePoint Online: How to Replace a Classic Root Site Collection with a Modern Site?

  • Hi Salaudeen,
    I have changed my root site on my sharepoint but the former root site had a site collection and some sites right under the top level domain and they were all moved to the new address
    How can i move out sites from archive to top level domain again or move its contents to ?


Leave a Reply

Your email address will not be published. Required fields are marked *