Forum Discussion

MarkusBundschuhDHBW's avatar
MarkusBundschuhDHBW
Copper Contributor
Apr 03, 2020
Solved

Invoke-SPOSiteSwap Issues

Hi all,

 

I want to swap the root site of our O365 tenant with a new communication site. The root site was never actively used so it ist a empty modernized classic team site. Publishing features are not enabled, so I have no configuration options for structural navigation or metadata navigation.

 

When I invoke Invoke-SPOSwapSite, I get an error that says I have to run the Sharepoint Page Diagnostic tool and resolve issues. When I run the tool against the source site (the communication site) the check displays no issues with that site (all checks green). When I run the tool against the root site (the classic team site), I get the attached error stating I have to enable caching on structural navigation.

 

My questions are:

  • Has the page diagnostic tool really to be run on the source AND the target site?
  • How can the error on the classic site be resolved? I already tried to turn on the publishing feature to get the site navigation options, but there is no checkbox to enable caching and switching to metadata navigation did not work either.

Thanks for any hints,

 

Markus

  • MarkusBundschuhDHBW 

     

    I had the same issue, contacted MSFT Support, but they did not have any solution available. I went and solved it myself. Apparently for large organisations (10000+ seats) you'll have to use the page diagnostic tool which works for Edge and Chrome. I don't  understand how this plugin communicates its findings back to Powershell, but apparently it does. Although I solved all the errors the diagnostic tool showed me the first few times I kept getting the same error in PS. What I did was the following:

     

    1) Created a blank page on the classic teamsite (current root) and promoted that to Start Page

    2) Created a blank page on the Communication Site (new to be root) and promoted that to Start Page

    3) Reran the Page Diagnostic Tool on both site collection homepages (both old an new)

    4) Relaunched my PowerShell session and executed the command (with -force and -nowait parameters)

    5) Worked!

     

    For some reason the new or old web parts on homepages block the siteswap from happening, but nobody knows what exactly goes wrong. Hope this helps.

     

9 Replies

  • I finally solved my problem too. After logging in as a user with editor permissions on the new portal site and running the SP diagnostic tool on the site without any errors (the check for structural navigation passed without any error this time), I was able to swap the old site with the new portal site with Invoke-SPSiteSwap. The CmdLet ran into a timeout, but the sites where swapped anyway.
    • HerschelJ's avatar
      HerschelJ
      Brass Contributor
      Thanks all for posting, I will be replacing our old SharePoint Online (2013-era) classic site with old webparts and subsites with a new modern site and doing my homework in case I run into trouble...
  • Jan_Hummelman's avatar
    Jan_Hummelman
    Copper Contributor

    MarkusBundschuhDHBW 

     

    I had the same issue, contacted MSFT Support, but they did not have any solution available. I went and solved it myself. Apparently for large organisations (10000+ seats) you'll have to use the page diagnostic tool which works for Edge and Chrome. I don't  understand how this plugin communicates its findings back to Powershell, but apparently it does. Although I solved all the errors the diagnostic tool showed me the first few times I kept getting the same error in PS. What I did was the following:

     

    1) Created a blank page on the classic teamsite (current root) and promoted that to Start Page

    2) Created a blank page on the Communication Site (new to be root) and promoted that to Start Page

    3) Reran the Page Diagnostic Tool on both site collection homepages (both old an new)

    4) Relaunched my PowerShell session and executed the command (with -force and -nowait parameters)

    5) Worked!

     

    For some reason the new or old web parts on homepages block the siteswap from happening, but nobody knows what exactly goes wrong. Hope this helps.

     

    • Samanth2250's avatar
      Samanth2250
      Copper Contributor

      Jan_Hummelman I know it's been 2 years since the last posts but I wanted to confirm that these steps worked for me to eliminate the page diagnostics errors that I fixed but wouldn't go away.  However, the powershell script still gave me an error: stating that the archive URL was already in use.  So I went through SP Admin Center, selected all sites, sorted A-Z and clicked in the ... to replace site.  Then it allowed me to add the new site URL and save.  So adding the blank pages to the old and new sites worked.  Thank you!

      • Jan_Hummelman's avatar
        Jan_Hummelman
        Copper Contributor
        You're most welcome and glad my old posts still help today 😉
    • mattwhiting's avatar
      mattwhiting
      Copper Contributor

      Jan_Hummelman I'm glad it worked for you; it certainly doesn't for me. Having gone through your steps, I still get "Warnings: [0]; Details: The Page diagnostics for SharePoint tool needs to be run to
      validate the home page. Learn More at https://aka.ms/perftool" and when I add the -force parameter I get "Invoke-SPOSiteSwap : A parameter cannot be found that matches parameter name 'force'."

       

      Looks to me like they took this parameter out - maybe it was being just too useful!

       

Resources