Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a content DB which is growing huge and so I want to move Different Site Collections to Different Content Databases based on the Managed path that Site collection belongs to .Can some one Help me with this

The script I presently have is helpful to move the site collections based on the Web Application But i want to do it based on the Content Database something like below

Get-SPSite -ContentDatabase "WSS_Content_"| foreach($site in $_.sites)

Can some one Help me with this

share|improve this question
add comment

1 Answer 1

If you want to see all site collection in that Content db then use this,

Get-SPSite -Limit All  -ContentDatabase contentdbname | select url, @{label="Size";Expression={$_.usage.storage}} 

Find SC in a Content DB

You can use this PS command to move site collection to a different content database, however make sure you have sufficient permissions as described in this article,

Move site collections between databases (SharePoint Server 2010)

Moving site collections between content databases You can use the Windows PowerShell command Move-SPSite to move site collections between content databases. Two procedures are provided here. The first procedure moves a single site collection to a new content database, and the second procedure moves multiple site collections to a new content database. To move a single site collection At the Windows PowerShell command prompt, type the following command:

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

Where: <http://ServerName/Sites/SiteName> is the name of the site collection.

<DestinationContentDb> is the name of the destination content database.

To move multiple site collections

Get-SPSite -ContentDatabase <SourceContentDb> | Move-SPSite -DestinationDatabase <DestinationContentDb>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.