DEV Community

Miguel Isidoro
Miguel Isidoro

Posted on • Originally published at blogit.create.pt on

How to convert a classic root site to Modern SharePoint in Office 365 using Invoke-SPOSiteSwap PowerShell cmdlet

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:

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 -TargetUrl -ArchiveUrl []

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:

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

  1. Supply your tenant’s administrator credentials
  2. 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.

Modern Communication Site As Tenant’s 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 hereand 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 hereand 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!

The post How to convert a classic root site to Modern SharePoint in Office 365 using Invoke-SPOSiteSwap PowerShell cmdlet appeared first on Blog IT.

Top comments (0)