Using Invoke-SPOSiteSwap to Swap in a New Root Site in Office 365 – Follow Up

Last week, I wrote a post about using Invoke-SPOSiteSwap to swap a new modern site into the root site of our Sympraxis tenant. While it worked just great, there were some follow on issues I wanted to document in case you might run into them, too. Nothing horrible, but a bit of required cleanup.

The old classic site we had in the root had subsites. I had been syncing the libraries in some of those subsites with OneDrive, so there were nice folders showing up in Windows Explorer where I would do my work with those files. After the swap, I started getting errors from OneDrive which were a little confusing.

While the error was saying :

We can't reach this library because of a service Issue. 
Restart OneDrive to try again. 

…in actual fact, those libraries simply weren’t there to sync anymore. No matter how many times I would restart OneDrive (and I did once before I realized the problem!), those libraries were never going to start syncing again. Instead, I needed to go into the OneDrive settings and Stop sync for the libraries which weren’t there anymore.

Then I just navigated to their new location and started syncing again. This is certainly an argument for not using subsites anymore.

You might say “Well, of course, Marc! This is all your fault!” Well, sure it is. But the errors didn’t tell me the right cause, so it might be useful for others to know what it means.

In the SharePoint Dev Weekly – Episode 49 call this week, Vesa Juvonen (@vesajuvonen) and Waldek Mastykarz (@waldekm) talked about the fact that links will NOT be fixed up in the site swap (43:11). I had been under the impression that they would be. This didn’t bite me in particular, but it’s something to watch out for.

Vesa also mentioned (46:23) that the Invoke-SPOSiteSwap cmdlet is currently hard-wired to prevent you from using it to swap a site into any location other than the root site. In my usual “trust but verify” mode, I tested it, and what he says is indeed true.

You end up with an error like:

Invoke-SPOSiteSwap : The target URL must be the root site or the search center site
 At line:1 char:1
 Invoke-SPOSiteSwap -SourceUrl https://sympraxis.sharepoint.com/sites/ …
 ~~~~~~~~~~~~~~~~~                           int.PowerShell.SwapSite CategoryInfo          : NotSpecified: (:) [Invoke-SPOSiteSwap], ServerException
 FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SwapSite

All in all, still a successful exercise. Happy swapping!

Similar Posts

10 Comments

  1. When you did your SiteSwap i noticed a few things that i cant find any info on. I did not see your left navigation bar on the modern site. Do you just have to re-enable that? Does it copy or move all your info (Document Libraries, Lists, Calendar, Etc..?) If not how do you get all that old info into your new site? Thanks

    1. @Anthony:

      When you do a Site Swap, you’re literally swapping the site into the root location. so everything in the SourceUrl site moves into that spot. You’ll probably want to have everything set up in that site before you do the swap.

  2. Hi Matt,
    Nice post! Currently we can do the SiteSwap in our test tenant with just 25 seats but in our prod tenant with 5000 seats it still says, Invoke-SPOSiteSwap : SwapSite operation not yet supported.

    I read somewhere that MS is rolling-out small tenants first but it should be finished in October. I guess I need to be patient but it’s so hard :-)

    Do you know anything regarding this roll-out strategy. Our tenant is in Western Europe.
    Thanks,
    Maarten

    1. @Maarten:

      The party line is they have rolled out to tenants up to 10000 users now. Have you checked recently? I expect if you put in a ticket, you can get it activated if it isn’t already.

      M.

  3. Is there any down time during a site swap when it involves the root site? When a root site is deleted, this action causes all of SharePoint and Teams to go down for the tenant. Just want to make sure such a thing isn’t possible performing a site swap on a tenant?

    1. @Jono:

      I haven’t see things go down when deleting the root site, but it’s not something one usually does. Using SPOSiteSwap should be an unusual occurrence, and you should plan accordingly. You’re changing the root site, and probably substantively, so you should treat it the same way you would any other major change. You’ll need some sort of change management plan and communication plan so people know the new site will be there after XXX date. I would think that – for the most part – you’d do a site swap after hours or over a weekend to allow for validation and testing.

      M.

  4. Hey Marc, It would be good to know if we can reverse the swap if there are unforeseen difficulties (par for the course for Msft). I assume so, but wondered if you know anyone who’s tried it? Regards!

  5. Thanks for the tip about getting rid of that OneDrive error. I’ve been trying to figure out how to deal with that and your blog was the only thing that helped. Cheers.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.