SharePoint Online: Move Subsite to Another Site using PowerShell
Requirement: Move Subsite to a new site in SharePoint Online.
How to Move a subsite in SharePoint Online?
Let's move a subsite to the root site in SharePoint Online using content and structure page:
PowerShell to move subsite to another site in SharePoint Online :
Let's move subsite to root site with PowerShell.
How to Move a subsite in SharePoint Online?
Let's move a subsite to the root site in SharePoint Online using content and structure page:
- Go to Site settings page >> Click on "Content and Structure" link (https://tenant.sharepoint.com/sites/your-site-collection/_layouts/15/sitemanager.aspx)
- Select the subsite from the Treeview >> Click on "Move" from the subsite's context menu.
- Select the target site and click on "OK" to move the subsite to the new site.
PowerShell to move subsite to another site in SharePoint Online :
Let's move subsite to root site with PowerShell.
#Set Parameter values $SiteURL = "https://crescent.sharepoint.com/sites/marketing/us/2017" $NewSiteURL = "/sites/marketing/2017" #Connect to PnP Online Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) #-UseWebLogin #Get the Web $Web = Get-PnPWeb #Move the site to New URL by Setting relative URL $Web.ServerRelativeUrl = $NewSiteURL $Web.Update() Invoke-PnPQueryThis moves the subsite under https://crescent.sharepoint.com/sites/marketing/us/2017 to https://crescent.sharepoint.com/sites/marketing/2017. Please note, this method works only within the site collection!
No comments:
Please Login and comment to get your questions answered!