Perform a Site swap from SharePoint Admin center
November 10, 2021
So when working with Viva Connection you might have created a seperate Home site for development while your old one lives on until you're done. When you are done, you might wanna swap places so the new site get's the root URL. This is how you do it
Admin Center
- Visit SharePoint Admin Center
https://yourtenant-admin.sharepoint.com/_layouts/15/online/AdminHome.aspx#/home
-
Press Active sites
-
Select Your root Site,
https://yourtenant.sharepoint.com/
- Make sure it isn't a hub site.
- Make Sure there isn't any retention policies in place for those two sites for now
- Remove the site as a Home Site for now
-
Add URL for your new site and press Save
-
This can take a small while as something in the background will run.
-
When the site swap is done, I recommend that you reindex the site. Some webpart and search can be cause Issues first 24-48 hours
Powershell
First you need latest SharePoint Module
Update-Module Microsoft.Online.Sharepoint.PowerShell -ForceInvoke-SPOSiteSwap`
-SourceURL https://yourtenant.sharepoint.com/sites/newSite `
-TargetURL https://yourtenant.sharepoint.com `
-ArchiveURL https://yourtenant.sharepoint.com/sites/oldSite -Force