Saturday, September 18, 2010

Convert Subsite to Site Collection and Site Collection to Subsite in SharePoint

During the migration of MOSS 2007 to SharePoint 2010, wanted to convert some of the large subsites into site collection in a separate content databases. How to convert a subsite to a site collection in SharePoint? sure, Its possible to promote subsite to site collection in SharePoint.

Follow these Steps to Convert Subsite to Site collection:

  1. Export the Source sub-site
  2. Create a new Site collection in Separate content database
  3. Import the backup into the site collection.

1. Export the subsite
Export the source sub-site using STSADM command line:
stsadm -o export -url <URL-of-the-Sub-site> -filename <Backup-File-Name> -includeusersecurity -versions 4

2. Create a New Site collection in its own Database, without assigning template
Execute this command line to create a new site collection in new content database.
stsadm -o createsiteinnewdb -url <Site collection URL> -owneremail <e-mail of the site owner> -ownerlogin <domain\username>  -title <Title-for-site-collection>  -databaseserver  <DB-Server-Name> -databasename <Database-name>

3. Import the SubSite Export(Backup) into the Site collection
Now, we need to import the sub-site into the newly created site collection. Use the STSADM command line:
stsadm -o import -url <Target-Site-collection-URL> -filename <backup-File-Name> -includeusersecurity
convert a subsite to a site collection in sharepoint 2010

To convert site collection to subsite:
Want the reverse? move a site collection to a subsite in SharePoint 2007? Simple: Export the site collection using stsadm -o export, creates a blank sub-site, and then import the exported site collection into sub-site using stsadm-o import.
 Just Export the Site collections and import them as Sub-site:
stsadm -o export -url -filename c:\sitecollection.bak -includeusersecurity -nofilecompression
stsadm -o import url -filename c:\sitecollection.bak -includeusersecurity -nofilecompression

Or you can use Third party products like: DocAve or ControlPoint to migrate SharePoint subsite to site collection. 

Browse to the Site collection, verify Page Layouts, master pages, content types, navigation, web parts and etc. Once tested, delete the sub-site using: stsadm -o deleteweb -url <sub-site-url>

Please note, In Export-Import you'll loose few things, such as:
  • Workflow Associations, History, Tasks
  • Alerts
  • Feature/Solutions activated
  • Recycle bin
If you get  “File not found" or "Page not found" don’t panic. Look into welcome page/Master page settings. If you are moving from one environment from another, make sure you have identical features/solutions deployed in both the environments.

In case of Publishing sites, It may lead to page layout issues (site collection pages will be pointing to old-sub-site’s page layouts).Use Gary’s STSADM extensions to resolve:

stsadm –o gl-repairsitecollectionimportedfromsubsite –sourceurl <sub-site-URL> -targeturl <Site-collection-URL>

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

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...