Change The Existing Sharepoint Site Template To Modern/communication Site Using Powershell Cmdlet

Vinodh
 
SharePoint MVP
September 14, 2019
 
Rate this article
 
Views
9980

In this blog, I have explained how to switch the existing classic site to modern sharepoint site and backup the existing site to archival site using Invoke-SPOSiteSwap

It requires sharepoint admin powershell version 16.0.8812.1200 or later.

Applicable for sharepoint online

Command:
Invoke-SPOSiteSwap -SourceUrl -TargetUrl -ArchiveUrl
Before run the site swap command connect to your sharepoint tenant using the below command
Connect-SPOService -Url
Connect-SPOService -Url "https://sharepointtechie-admin.sharepoint.com"
Provide the username and password for your tenant to connect.

My root site collection is a classic site template. But i want existing communication site to be replaced as a root site collection.

I have a communication site with me its already developed

Now run the powershell cmdlet to swap the existing communication site with classic template

SourceUrl: The site template what ever you want like Modern/Classic/Communication/Search to replaced with target site collection

TargetUrl: The site you want to replace the template

ArchiveUrl: It moves the existing site collection to archival

Note: ArchiveUrl does not contain the already existing sharepoint site collection and site collection from the recycle bin. You need to provide the unique site collection for ArchiveUrl. It create the site collection URL provided and move the content into it from the target site collection.

Finally! check the root site collection It has been replaced with site template we given

Hit the Archived Site URL. It has been replaced successfully.

Category : PowerShell, SharePoint

Author Info

Vinodh
 
SharePoint MVP
 
Rate this article
 
Vinodh is a Microsoft MVP for SharePoint (Office Apps and Services) having 5+ years of experience in Microsoft Technologies. His interest and expertise includes SharePoint Online Development, PowerApps Development, Flows ...read more
 

Leave a comment