Do you have an old Office 365 tenant with a classic Team Site as homepage? Wanting to convert a classic root site to a modern SharePoint site?
Now, using the recently released Invoke-SPOSiteSwap PowerShell cmlet, you convert your classic tenant’s root site collection to a modern site collection (for example a modern Communication Site).
Introduction
In Microsoft Ignite 2018, announced that all new Office 365 tenants would start getting the modern Communication Site as the root site by default.
Microsoft will soon release the possibility for administrators to set a Communication Site as the experience for the root site of a tenant (should be rolled out in September, more details here) and until now, there wasn’t an easy way to convert a classic root site collection into a modern SharePoint site. Now, with this release, we will finally be able to get a modern SharePoint site as the root site collection even on an older Office 365 tenant!
The Solution
Dependencies
To be able to modernize your SharePoint homepage, you will first need to download and install SharePoint Online Management Shell version 16.0.8812.1200 or later. To get the latest version of the SharePoint Online Management Shell, click here or run the following PowerShell command:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -force
NOTE: If the Invoke-SPOSiteSwap PowerShell cmlet is not available yet in your tenant, just wait a little bit more, since it is currently being rolled out!
How It Works
In the steps below we are assuming the following:
- You have a classic root site collection at https://yourtenant.sharepoint.com
- You have a modern Communication Site already created in your tenant (for example at https://yourtenant.sharepoint.com/sites/modernintranet)
Important Note: the Invoke-SPOSiteSwap cmdlet doesn’t transform your existing classic root site collection into a modern site collection. Instead, it replaces the current root site collection (a class site collection) by another existing site collection, in this example, a modern Communication Site.
The syntax of the Invoke-SPOSiteSwap cmdlet is the following:
Invoke-SPOSiteSwap -SourceUrl <string> -TargetUrl <string> -ArchiveUrl <string> [<CommonParameters>]
The main parameters of the cmdlet are:
-SourceUrl
URL of the source site. The site at this location must exist before performing the swap.
If the target is the root site at https://yourtenant.sharepoint.com then the source site must be either a Team Site (STS#0), a Modern Team Site (STS#3), or a Communication Site (SITEPAGEPUBLISHING#0).
In our example, this will be our modern Communication Site at https://yourtenant.sharepoint.com/sites/modernintranet and it represents the site that will replace our old classic Team Site.
-TargetUrl
URL of the target site that the source site will be swapped to. The site at this location must exist before performing the swap.
The target site must be the either:
- The root site at https://yourtenant.sharepoint.com; or
- The search center site at https://yourtenant.sharepoint.com/search
In our example, this will be our classic Team Site root site collection at https://yourtenant.sharepoint.com that will be replaced by our modern Communication Site.
-ArchiveUrl
URL to where the target site will be archived. There should be no existing site, including a deleted site in the Recycle Bin, at this location before performing the swap.
In our example, this will the URL where our classic Team Site root site collection will be archived to.
Pulling the Trigger
Follow the steps below to do the magic:
- Open a PowerShell console (as adminstrator) and type the SharePoint Online authentication command. In this command, you must use your tenant’s Admin URL
Connect-SPOService -Url https://yourtenant-admin.sharepoint.com - Supply your tenant’s administrator credentials
- Run the following command:
Invoke-SPOSiteSwap
-SourceUrl https://yourtenant.sharepoint.com/sites/modernintranet
-TargetUrl https://yourtenant.sharepoint.com
-ArchiveUrl https://yourtenant.sharepoint.com/sites/oldroot
Making the swap will take about one minute and it is pretty straightforward. After the swap, you should have a brand new Communication Site as your homepage.
Limitations
Making the swap will take about one minute and it is pretty straightforward, but you must take some restrictions into consideration. Neither the source or target site can be:
- Neither the source or target site can be connected to an Office 365 Group
- Neither the source or target site can be a Hub Site – if a site is a hub site, unregister it as a hub site, swap the root site, and then register the site back as a hub site
- Neither the source or target site can be associated with a Hub Site – if a site is associated with a hub, disassociate the site, swap the root site, and then reassociate the site
- Only sites within the same domain, for example, https://contoso.sharepoint.com can be swapped
- The source site must be a modern team site (STS#3), a communication site (SITEPAGEPUBLISHING#0), or a classic team site (STS#0)
- All subsites contained with the source and target sites will be swapped
- Any sharing links or bookmarks will need to be recreated after the site swap
Conclusion
If you want a modern experience in your existing Office 365 tenant and convert your classic team site into a modern SharePoint Modern Experience, this is the easiest way to go.
Before doing the swap, there are a few things you need to consider:
- Assign permissions to the new Communication Site so that users can access the new site
- Plan navigation (ex: Mega Menu navigation) to ensure navigation to your existing content
- Configure your new Communication Site homepage to show the most relevant content you want to show to your users
- Migrate content from the old classic root site collection to the new Communication Site
Another great thing about this approach is that if you don’t like the result of the swap, you can always swap back using the same PowerShell command.
Related Articles
To learn why your business should migrate to SharePoint Online and Office 365, click here and here.
If you are a SharePoint administrator or a SharePoint developer who wants to learn more about how to install a SharePoint 2019 farm in an automated way using PowerShell, I invite you to click here and here.
If you learn how to greatly speed up your SharePoint farm update process to ensure your SharePoint farm keeps updated and you stay one step closer to start your move to the cloud, click here.
If you prefer to use the traditional method to update your farm and want to learn all the steps and precautions necessary to successfully keep your SharePoint farm updated, click here.
If you want to learn how to upgrade a SharePoint 2013 farm to SharePoint 2019, click here and here.
If SharePoint 2019 is still not an option, you can learn more about how to install a SharePoint 2016 farm in an automated way using PowerShell, click here and here.
If you want to learn how to upgrade a SharePoint 2010 farm to SharePoint 2016, click here and here.
If you are new to SharePoint and Office 365 and want to learn all about it, take a look at these learning resources.
If you are work in a large organization who is using Office 365 or thinking to move to Office 365 and is considering between a single or multiple Office 365 tenants, I invite you to read this article.
If you want to know all about the latest SharePoint and Office 365 announcements from Ignite and some more recent announcements, including Microsoft Search, What’s New to Build a Modern Intranet with SharePoint in Office 365, Deeper Integration between Microsoft Teams and SharePoint and the latest news on SharePoint development, click here.
If your organization is still not ready to go all in to SharePoint Online and Office 365, a hybrid scenario may be the best choice. SharePoint 2019 RTM was recently announced and if you to learn all about SharePoint 2019 and all its features, click here.
Happy SharePointing!
Thanks for this really helpful article. I was looking for this feature. Called Microsoft support about this, they said they’ve added the problem as an update to the roadmap (https://www.microsoft.com/en-us/microsoft-365/roadmap?filters=&searchterms=46338). The update is expected at September this year.
Thanks to you my problem is solved, THANKS!
Hello Sjoerd, thanks for the feedback and glad it was useful!
Thanks for the article. You stated that neither can be a Hub Site. But, after the migration, can you set the root tenant (in my case a Comm site) as an hub site?
Thanks again
Hello, check the limitations section (just updated the post):
– Neither the source or target site can be a Hub Site – 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
– Neither the source or target site can be associated with a Hub Site – if a site is associated with a hub, disassociate the site, swap the root site, and then reassociate the site
Hope it helps!
I have a Team SharePoint site that among other things hosts several dozen OneNote Notebooks. We would like to swap the Team site out with a Communication Site without destroying the links to our OneNote Notebooks. Do you know if this is possible or any tips to make it as painless as possible? Thanks.
Hello Steve,
If I understand corretly, the OneNote notebooks are in your Team Site that you want to replace by a Communication Site.
Is the Team Site your root site and is it a classic site?
If the answer to both questions is yes, you can replace the classic Team Site with the Communication site using the Invoke-SPOSiteSwap cmdlet:
Invoke-SPOSiteSwap
-SourceUrl https://yourtenant.sharepoint.com/sites/CommunicationSite
-TargetUrl https://yourtenant.sharepoint.com
-ArchiveUrl https://yourtenant.sharepoint.com/TeamWork
Your team site (if it is the root site) will be renamed to https://yourtenant.sharepoint.com/TeamWork (just an URL example, you can supply any available URL). With this operation, hopefully OneNote notebooks will not get broken, however I have not tested that scenario!
If your intention is not replace a classic root site by a Communication Site, please let me know in more detail, what is your requirement, so that I can see if I can help!
Thanks
Miguel
Thank you for this. Diamond search result in trying to convert a classic root site. I have a question regarding the target.
I have a classic root site with no content at the moment. I want to convert it using the method above. I noticed that the target site can be the same URL, how does that work or am I not following along correctly?
-TargetUrl
URL of the target site that the source site will be swapped to. The site at this location must exist before performing the swap.
The target site must be the either:
The root site at https://yourtenant.sharepoint.com; or
The search center site at https://yourtenant.sharepoint.com/search
What Im trying to do is convert the same root site
Source URL: https://yourtenant.sharepoint.com
Targer URL: https://yourtenant.sharepoint.com
is that possible?
Hello Jeremy,
You must have two sites: one modern and one classic. The modern one is the one you want to be your new root site. The old one is the one you want to replace as the root site.
Steps:
1. Create a new modern site and manage content and navigation according to your needs. URL example: https://yourtenant.sharepoint.com/sites/modernintranet
2. Use the following command:
Invoke-SPOSiteSwap
-SourceUrl https://yourtenant.sharepoint.com/sites/modernintranet
-TargetUrl https://yourtenant.sharepoint.com
-ArchiveUrl https://yourtenant.sharepoint.com/archive
After you run this command, the classic root site URL will be renamed to https://yourtenant.sharepoint.com/archive and your modern site at https://yourtenant.sharepoint.com/sites/modernintranet will be renamed to https://yourtenant.sharepoint.com and it will be your new root site.
Hope it helps!
I believe if the url for the site changes, it will change the OneNote links. I have not tested swapping a site, but I have not seen anything to suggest that it would not break the existing urls/links.
We decided to keep the original site with the OneNote notebooks to not break the links, and create a new site that has a link to the original site’s OneNote Files. Someday in the future we will likely move all the OneNotes to the new site, but we will kick that down the road for now!
Thank you.
Hello Steve,
It seems ok to me.
Thanks