2

We have 650 site collections all in one Content DB with 800+ GB in size.
Because of this huge size, performance goes down and we have decided to split the DB into 10 different content DBs with maximum 80 GB per content DB.
We can use Move-SPSite Powershell command to move one Site collection to destination database.
But as in our case we have 650 site collections, and we want to move 65 site collections to one content DB. And in this way, we will split into 10 different content DBs.
All we want to do this by Powershell. What is the best possible way to do this?

1. Is there any command to move multiple site collections at ones?
2. Is there Powershell command to create content DB?

Any good suggestion can help?

1 Answer 1

3

As you said you can use the command Move-SPSite on more site collection.
Select the site collection (by matching the url) and then move them.

Get-SPSite -Limit All | Where-Object {$_.Url -match "mySiteName" -or $_.Url -march "mySiteName1" } | Move-SPSite -DestinationDatabase ContentDb2

To create a new content DB, you can use New-SPContentDatabase

New-SPContentDatabase "MyDatabase" -DatabaseServer "MyServer" -WebApplication http://sitename

New-SPContentDatabase

6
  • Thanks! After Moving Site collections to different content DBs, we can still access site collections with same URLs as we were before, right?
    – SPBeginer
    Commented Apr 21, 2015 at 10:24
  • yes, remember that you can move the site collection only within the same web application. Remember to shrink the contentDB after moving. (so you will have back the free space). Enjoy!
    – Nk SP
    Commented Apr 21, 2015 at 10:26
  • When you say, Shrink the contentDB, it means i need to shrink the source content DB? What about Deleting the source DB after moving to new content DBs? please clarify?
    – SPBeginer
    Commented Apr 21, 2015 at 10:48
  • If you are going to delete the source DB after movig the site collection, no problems, but if you will keep the source contentDB, the size will be always the same (also after moving the site collection!). To resize to DB you have to shrink log and data files.
    – Nk SP
    Commented Apr 21, 2015 at 10:49
  • Thanks! After shrinking the source DB, 100% free space will be backed?
    – SPBeginer
    Commented Apr 21, 2015 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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