How to convert a classic root site to Modern SharePoint in Office 365 using Invoke-SPOSiteSwap PowerShell cmdlet
Tags: sharepoint
Published: 2024-01-24 16:17:56

---
title: How to convert a classic root site to Modern SharePoint in Office 365 using Invoke-SPOSiteSwap PowerShell cmdlet
published: true
date: 2019-08-27 00:05:30 UTC
tags: SharePoint
canonical_url: https://blogit.create.pt/miguelisidoro/2019/08/27/how-to-modernize-your-tenant-root-site-collection-in-office-365-using-invoke-spositeswap/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-modernize-your-tenant-root-site-collection-in-office-365-using-invoke-spositeswap
---

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](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/invoke-spositeswap?view=sharepoint-ps) 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](https://dev.to/mlisidoro/whats-new-for-sharepoint-and-office-365-after-microsoft-ignite-2018-7ga), 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](https://www.microsoft.com/en-us/microsoft-365/roadmap?filters=&searchterms=46338)) 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](https://www.microsoft.com/en-in/download/details.aspx?id=35588) 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:

1. 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  
2. Supply your tenant’s administrator credentials 
3. Run the following command:  
  
Invoke-SPOSiteSwap  
   -SourceUrl https://yourtenant.sharepoint.com/sites/modernintranet  
   -TargetUrl https://yourtenant.sharepoint.com  
   -ArchiveUrl https://yourtenant.sharepoint.com/archive

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.

![](https://i1.wp.com/blogit.create.pt/wp-content/uploads/2019/08/SharePoint-comm-site.jpg?w=696&ssl=1)<figcaption>Modern Communication Site As Tenant’s HomePage</figcaption>

## 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](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 [h](https://dev.to/mlisidoro/why-you-should-migrate-to-office-365-part-1-264l)[ere](https://dev.to/mlisidoro/why-you-should-migrate-to-office-365-part-1-264l) and [here](https://dev.to/mlisidoro/why-you-should-migrate-to-office-365-part-2-5943).

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](https://dev.to/mlisidoro/how-to-install-a-sharepoint-2019-farm-using-powershell-and-autospinstaller-part-1-5bjp) and [here](https://dev.to/mlisidoro/how-to-install-a-sharepoint-2019-farm-using-powershell-and-autospinstaller-part-2-1b9k).

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](https://dev.to/mlisidoro/how-to-speed-up-the-installation-of-sharepoint-cumulative-updates-using-powershell-step-by-step-434c).

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](https://dev.to/mlisidoro/how-to-install-sharepoint-cumulative-updates-in-a-sharepoint-farm-step-by-step-f50).

If you want to learn how to upgrade a SharePoint 2013 farm to SharePoint 2019, click [here](https://dev.to/mlisidoro/how-to-upgrade-from-sharepoint-2013-to-sharepoint-2019-step-by-step-part-1-2jkn)and [here](https://dev.to/mlisidoro/how-to-upgrade-from-sharepoint-2013-to-sharepoint-2019-step-by-step-part-2-feo).

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](https://dev.to/mlisidoro/how-to-install-a-sharepoint-2016-farm-using-powershell-and-autospinstaller-part-1-54m5) and [here](https://dev.to/mlisidoro/how-to-install-a-sharepoint-2016-farm-using-powershell-and-autospinstaller-part-2-5e36).

If you want to learn how to upgrade a SharePoint 2010 farm to SharePoint 2016, click [here](https://dev.to/mlisidoro/sharepoint-upgrade-upgrading-a-sharepoint-2010-farm-to-sharepoint-2016-step-by-step-part-1-55n7)and [here](https://dev.to/mlisidoro/sharepoint-upgrade-upgrading-a-sharepoint-2010-farm-to-sharepoint-2016-step-by-step-part-2-4f18).

If you are new to SharePoint and Office 365 and want to learn all about it, take a look at these [learning resources](https://dev.to/mlisidoro/sharepoint-and-office-365-learning-resources-162e).

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](https://dev.to/mlisidoro/pros-and-cons-of-single-tenant-vs-multiple-tenants-in-office-365-2hd9).

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](https://dev.to/mlisidoro/whats-new-for-sharepoint-and-office-365-after-microsoft-ignite-2018-7ga).

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](https://dev.to/mlisidoro/meet-the-new-modern-sharepoint-server-sharepoint-2019-rtm-is-here-2oak).

Happy SharePointing!

The post [How to convert a classic root site to Modern SharePoint in Office 365 using Invoke-SPOSiteSwap PowerShell cmdlet](https://dev.to/mlisidoro/how-to-convert-your-classic-root-site-collection-in-office-365-to-modern-sharepoint-7jo) appeared first on [Blog IT](https://blogit.create.pt).