While swaping issue with sharepoint online sites

sns 9,226 Reputation points
2021-09-18T12:44:59.07+00:00

I am following below article to use PnpSwap, however I am not clear on this. and I see following error.
https://pnp.github.io/powershell/cmdlets/Invoke-PnPSiteSwap.html
Please clarify my below questions/doubts:

  1. Which template is supported for swapping? how do figure out template name of the site?
  2. If I want to swap from one of the team site to root site of SharePoint online, source and target site urls are enough why we need archive URL? what is that archive site?
  3. Does it work only if target is communication133208-capture.png site, in other cases does not it work?
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,052 questions
0 comments No comments
{count} votes

Accepted answer
  1. JoyZ 18,051 Reputation points
    2021-09-20T08:18:41.81+00:00

    @sns ,

    1.Group#0 is a site template ID of Team Site with Microsoft 365 Group, this command needs the source and target sites can't be connected to an Office 365 group. They also can't be hub sites or associated with a hub.

    PnP PowerShell to Get SharePoint Online Site Templates:

    $SiteUrl="https://tenant.sharepoint.com/sites/Team1"  
    $UserName="julie@tenant.onmicrosoft.com"  
    $cred = Get-Credential -UserName $UserName -Message "Please enter password for $UserName"  
    Connect-PnPOnline -Url $SiteUrl -Credentials $cred  
    
    #Get the Context & Web Objects  
    $ClientContext = Get-PnPContext  
    $Web = Get-PnPWeb   
    
    #Get All Web Templates  
    $WebTemplateCollection = $Web.GetAvailableWebTemplates(1033,0)  
    $ClientContext.Load($WebTemplateCollection)  
    $ClientContext.ExecuteQuery()  
    
    #Get the Template Name and Title  
    $WebTemplateCollection | Select Name, Title  
    

    2.Note, when the swap is initiated, the target site is moved to the archive location and the source site is moved to the target location. By default, a site redirect is created at the source location that will redirect traffic to the target location.

    3.It will work if the source site and target site are not group connected sites or hub sites or associated with a hub.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful