Site swap

It’s now possible to replace that old classic default SharePoint root site that is automatically added in your tenant with a modern site.

Instead of having a “dead” classic root site that noone uses, you can replace it with a site built on modern templates like a communication site, and perhaps make that your intranet start site. The root site can not be deleted, as it hosts the SharePoint home page, but you can now replace it:

This is an example of a classic root site
This is an example of a modern Communication Site

To do the replacement, you must run a PowerShell cmdlet called Invoke-spositeswap (this cannot be done in the UI). I also talk about this in our latest podcast episode of WITGirls Podcast:

The cmdlet swaps the location of a source site with a target site while archiving the original target site.

When the swap is initiated, the target site is moved to the archive location and the source site is moved to the target location. If you have any sub sites on your root site, they will also be moved into the archive. (I chose to delete my archived site later since it was empty.)

You must use the SharePoint Admin PowerShell version 16.0.8812.1200 or later. You must be a Global Admin to run this.

The source and target sites can’t be connected to an Office 365 group. They also can’t be hub sites or associated with a hub. If a site is a hub site, unregister it as a hub site, swap the root site, and then register the site as a hub site. When you unregister the hub site, all associated sites are automatically disassociated, and when you are done with the site swap and register your site as a hub again – they will be associated back automatically.

Steps to do a Site Swap

First go to the SharePoint Admin center and look in “Active Sites” to check if the site is a hub site. If it is a hub, unregister it and then all the associated sites will automatically be disassociated. Filter out all sites that belongs to the hub to have full control of what sites belongs to the hub and do a screen shot (just to be sure that all are added back correctly later):

Then select the hub site and choose “Unregister as hub site”

Answer Yes on the statement that all associated site will be disassociated.

Now open SharePoint Online Management Shell. I always right click and run as administrator:

You must connect first and then sign in. Use this cmdlet

Connect-SPOService -Url -credential

Then run the cmdlet below where SourceURL is the site that you want to replace your old site with, that is maybe your new beautiful looking communication intranet site or similar 🙂 The TargetURL is the old site that you want to replace, typically a root site. The ArchiveURL is the location where the old site will be moved into. The archive site must not exist when you run this!


If all goes well you should have your new site as the root site! Now you have to go back into the SharePoint Admin center and register your site as a hub site again. All the associated sites will be reconnected! Magic 🙂

I always add the company logo up in the top navigation bar so that users can click on that to easy locate the intranet site. After the site swap you have to update the link manually by going to Admin Center and click on Settings and then Organization profile. Change the link under “Make the logo clickable”:

If you had the site linked under “Featured sites” on the SharePoint home page, just make sure that the link is updated there too:

You can check that the old site has been moved to the archive by going to

Some links may not work right after the change. If you click on a news page on your intranet now, it may link to the old URL. But it will be updated, just give it some time.

0 0 votes
Rate this article!
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
oldest most voted
Inline Feedbacks
View all comments

[…] Site swap […]