Step-by-Step Guide: Migrating from Classic to Modern Site in SharePoint Online
Tags: sharepoint, development, developers, programming
Published: 2023-08-01 05:39:01


![Migrating from Classic to Modern Site in SharePoint Online](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0x2gtogi81j7gjk6x62q.png)

SharePoint Online offers a range of features and customization options to enhance collaboration and productivity within organizations. One notable improvement is the ability to replace a classic root site with a modern site, providing users with a more modern and intuitive user experience. In this article, we will explore the step-by-step process of replacing a classic root site in SharePoint Online with a modern site.

## How to replace a Classic Root Site with a Modern Communication Site in SharePoint Online?

To change the root site from a classic to a modern experience, follow these steps:

1. Login to the SharePoint Admin Center by accessing the URL: [https://<yourtenant>-admin.sharepoint.com](https://<yourtenant>-admin.sharepoint.com).
2. Once logged in, expand the "**Sites**" section and select "**Active Sites**".
3. Create a new communication site or modern Team site without an Office 365 group. For example, you can create a site with the URL: [https://crescent.sharepoint.com/sites/intranet](https://crescent.sharepoint.com/sites/intranet).
4. From the list of sites, select the existing root site that you want to replace.
5. In the toolbar, click on the "**Replace Site**" button.

![root site from a classic to a modern experience](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8bg4i8av0uee6dx3du4.jpg)

6. A dialog box will appear, asking you to enter the URL of the new site. Enter the URL of the modern site you created in step 3.
7. Click on the "**Replace**" button to initiate the replacement process.
8. The root site will be replaced with the new site you entered. The existing root site will be saved as an archive for future reference.

By following these steps, you can easily change the root site from a classic to a modern experience in SharePoint Online.

## Convert Classic Root Site Collection to Modern site using PowerShell

If you prefer to use PowerShell to replace the classic root site with a modern site, you can follow the steps outlined below:

## Step 1: Create a new modern SharePoint site collection using a communication site template

The first step to replace a classic root site with a modern site is to create a new modern site collection using a communication site template. This step can be completed using PowerShell by running the following cmdlet:

New-SPOSite -Template "**SITEPAGEPUBLISHING#0**" -Title "**New Modern Site**" -Url [https://<yourtenant>.sharepoint.com/sites/newmodernsite](https://<yourtenant>.sharepoint.com/sites/newmodernsite)

The cmdlet creates a new modern SharePoint site collection using the communication site template with the specified title and URL. In this example, the URL is set to [https://<yourtenant>.sharepoint.com/sites/newmodernsite](https://<yourtenant>.sharepoint.com/sites/newmodernsite).

Once the modern site collection is created, SharePoint will automatically create a default homepage, news section, and navigation structure, making it easy to customize and start using.

## Step 2: Execute the Invoke-SiteSwap cmdlet to start replacing the old site with the new one

The second step is to execute the Invoke-SiteSwap cmdlet to start the process of replacing the old classic root site with the new modern communication site. This cmdlet performs all the necessary steps to swap the old site with the new one, including archiving the old site for future reference.


![Execute the Invoke-SiteSwap cmdlet to start replacing the old site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bda3e2acwiw74nldwjny.jpg)

The cmdlet can be executed using the following command:

Invoke-SiteSwap -SourceUrl [https://<yourtenant>.sharepoint.com](https://<yourtenant>.sharepoint.com) -TargetUrl [https://<yourtenant>.sharepoint.com/sites/newmodernsite](https://<yourtenant>.sharepoint.com/sites/newmodernsite)

The -SourceUrl parameter specifies the URL of the old classic root site that needs to be replaced, while -TargetUrl specifies the URL of the new modern site that was created in the previous step.

Once the cmdlet is executed, SharePoint will begin the process of swapping the old classic root site with the new modern communication site. The process can take several minutes to complete, depending on the size of the site and the amount of data that needs to be migrated.

During the process, SharePoint will create a temporary site URL that will serve as the primary URL for the new site until the swap is complete. Once the swap is complete, the temporary site URL will become the primary site URL, and the old classic root site will be archived for future reference.

## Summary

Upgrade to Modern SharePoint Online with Expert [SharePoint Development Services and Solutions](https://cloudstakes.com/services/sharepoint)! Transition effortlessly from classic to modern root sites using SharePoint Admin Center or PowerShell. Say goodbye to limitations and embrace the power of modern sites with CloudStakes' SharePoint solutions. Maximize collaboration, productivity, and user experience for your organization today!