Sunday, February 3, 2013

Move SharePoint Site from one subsite to another within a Site Collection

Had a requirement to move a SharePoint site from one subsite to another site of the same site collection. Source site URL was: http://sharepoint.crescent.com/teams/marketing/us/Policies/ and it should be moved to http://sharepoint.crescent.com/teams/marketing/Policies/ ultimately, the aim was to move the "Policies" SharePoint site from "us" site to its top level site "marketing".

So, we need to move the subsite "Policies" which is under an another subsite "US" to Top level site "Marketing". Yes, fairly simple! I can do export-Import (Stsadm -o Export or Export-SPWeb). But found another easier way today: Edit "ServerRelativeUrl" property of SPWeb!

PowerShell:

#Get the Source Site
$web=Get-SpWeb "http://sharepoint.crescent.com/teams/marketing/us/Policies/"
$web.AllowUnsafeUpdates=$true
#Set the Target URL
$web.ServerRelativeUrl="/teams/marketing/Policies/"
$web.AllowUnsafeUpdates=$false
$web.update

As SharePoint Manager Tool supports write back some of the properties, we can utilize this tool to update the "ServerRelativeUrl" property of SPWeb.
Move SharePoint Site from one subsite to another within a Site Collection

Just updated Server relative Url property, Save it back, Done!



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

1 comment :

  1. Would this work for sites on SharePoint Online by chance?

    ReplyDelete

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...