Forum Discussion
Sharepoint Replace Root Site
Hi dandelly
You need to connect to tenant's SharePoint Admin Url with Connect-SPOService.
Connect-SPOService -Url https://<tenant URL>-admin.sharepoint.com
I'm pretty new to this stuff! I don't understand what the below means can you direct me a little. Once I getv the site swapped I can build sites easily! It is just the coding part i'm unsure of.
- dandellyAug 28, 2020Copper Contributor
hiMatti Paukkonen and everyone that helped.
Thanks I now have a larger set of IT skills and the start of my School's Sharepoint site! Thanks again.
- Matti PaukkonenAug 28, 2020Iron Contributor
- CissongAug 27, 2020Brass Contributor
Hello dandelly
Did you try this from the GUI already and it did not work. then you might need to go through powershell to do this
If you are using powershell.
First you need to connect to your SharePoint service by running this
Connect-SPOService
url- https://teraberi-admin.sharepoint.com/ (your SharePoint admin center admin URL)
and then run this
Invoke-SPOSiteSwap -SourceUrl https://contoso.sharepoint.com/sites/CommunicationSite -TargetUrl https://contoso.sharepoint.com -ArchiveUrl https://contoso.sharepoint.com/sites/Archive
what this does is this
Archives the existing site at https://contoso.sharepoint.com/ to https://contoso.sharepoint.com/sites/Archive and moves https://contoso.sharepoint.com/sites/CommunicationSite to https://contoso.sharepoint.com./ A site redirect will be created at https://contoso.sharepoint.com/sites/CommunicationSite that will redirect any requests to https://contoso.sharepoint.com./