Home > SharePoint > Sharepoint – move subsite to a new site collection (and new database)

Sharepoint – move subsite to a new site collection (and new database)


Sometimes we need to rearrange large size content database into smaller pieces to make each lower than 100 GB (Best Practice)

This is easy enough if we had organize the content in sitecollections, in this case we can move the sitecollection using the powershell command:

Move-SPSite <http://ServerName/Sites/SiteName> -DestinationDatabase <DestinationContentDb>


On the other hand the issue requires more effort if we must extract a subsite and create a dedicated Site Collection/DataBase.

Here are some steps and work to be done to achieve the goal:


STEP-1: Some assesment and planning occurs first:

-Identify  used Content Types

-Identify used Features

-Identify used Workflows

-(Identify Parent Site Template)

-(Identify Parent Site Language)


STEP-2: Create a site collection MySiteColl1 (with a  dedicated DataBase: WSS_Content_MySiteColl1)



-Enable Features

-Enable WorkFlows

-Copy Content Types

This is quite easy using Gary Laponte tool: http://www.falchionconsulting.com/PowerShellViewer/Default.aspx?Version=SP2013&Cmdlet=Copy-SPContentType



Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
# My Content Types
Copy-SPContentType -SourceContentType $MyCtype -SourceWeb $siteSRC -TargetWeb $siteDST
Write-host "$MyCtype Copied"


(Backup the entire SiteCollection so we have a recovery point just in case of Rollback)

Export Site

STSADM (export/import)

Stsadm - o export -url http://source/mysite1 -includeusersecurity -versions 4 -filename \\backup\mysite1-Backup.bak


Powershell  (export/import)

Export-SPWeb http://srv1/mysite1 -includeusersecurity -includeversions All -path \\backup\mysite-Backup.bak

(then rename your Site so  your users are not able to use it anymore)



Import Site

STSADM (export/import)

Stsadm -o import -url http://destination/mysitecoll1/mysite1 -filename \\backup\mysite1-Backup.bak -includeusersecurity


Powershell  (export/import)

Import-SPWeb http://destination/mysitecoll1/mysite1 -path \\backup\mysite1-Backup.bak -includeusersecurity

(then create a new Link to the new Site)




Delete Old Site.

Pay attention: this operation is not simple as it seems to be if the old site is big enough (more than 20GB)

In my opinion, best way to do it is deleting the old site piece by piece (working on libraries)

Another tip is to turn off the Recycle Bin (just for the time we do this specific maintenance).


Categorie:SharePoint Tag:
%d blogger hanno fatto clic su Mi Piace per questo: