Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

Moving a Sharepoint Sub Site to its own Site Collection in 3 easy steps

, 29 Mar 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
Three easy steps in moving your Sub Site in its own Site Collection.

Moving a Sharepoint Sub Site to its own Site Collection why should I do that?  Well, there might be a lot of reasons on doing this but for me its more handing over the Site collection Administration to the business which enables business owners to choose themes, manage security within the site collection, manage activated solutions and deploy other customizations.  Another good reason for me is about Quota Management which I can’t do in a Sub Site model.  How about you what's you reason?

So whatever your reason is I guess you either want to do it or thought of doing it that is why you are reading this article.  So let’s get started and perform that 3 easy steps in moving your Sub Site in its own Site Collection.

On this demo we will be moving a Sub Site called “Sandbox” which is located in http://someURL/SomeTeamSite/sandbox


Step 1: Export your subsite by using the Export-SPWeb command.

You can do this on your Sharepoint Server and run the command using the SharePoint 2010 Management Shell.  For this sample I had used the following command

Export-SPWeb -Identity "http://someURL/SomeTeamSite/sandbox/" -Path "C:\Exported Sub Site\SandboxSubsSite.cmp" -IncludeUserSecurity -IncludeVersions all

What that command does is basically export the sub site to a .cmp file where we included all Security Settings and Versions for more options check out Export-SPWeb on TechNet

You will notice once it exports you will have a log file showing you whats been done during the export process.

Step 2: Create you site collection.  This is where you will host your new site.  

Still on the Sharepoint Server (you can also do this remotely), go to “SharePoint 2010 Central Administration” then into “Application Management” then “Site Collections” then “Create a Site Collection”.

Indicate all of the properties needed

Take note you can also create managed paths, which means you can create a site at a specific path. To do that click on “Define Manage Paths” under the “Web Site Address”.

Once everything is set up properly you will receive a confirmation that your site collection was created.

Step 3: Import your Content Migration Package (CMP) file that you exported using Import-SPWeb.

Still in the Sharepoint Server using the SharePoint 2010 Management Shell issue the Import-SPWeb command, for this sample it would be something like this

Import-SPWeb "http://someURL/sites/Sandbox" –Path "C:\Exported Sub Site\SandboxSubsSite.cmp"

Like Export-SPWeb the Import-SPWeb can have several parameters which you can see on TechNet

It will also create an Import log and once the import finishes your all good to go.

Now check your new site collection and compare to the sub site, and if your happy feel free to remove the subsite.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Raymund Macaalay
Technical Lead
New Zealand New Zealand
http://nz.linkedin.com/in/macaalay
http://macaalay.com/
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
SuggestionPromote Subsite to Site Collection PinmemberMember 1062458825-Feb-14 6:16 
QuestionThis's a good solution. PinmemberMember 294094918-Apr-13 12:19 
QuestionTried and Failed PinmemberSP Joe22-May-12 11:02 
QuestionNice Job PinmemberRobert P. Howard3-Apr-12 14:06 
AnswerRe: Nice Job PinmemberRaymund Macaalay3-Apr-12 14:44 
GeneralRe: Nice Job PinmemberRobert P. Howard3-Apr-12 16:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 29 Mar 2012
Article Copyright 2012 by Raymund Macaalay
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid