Sunday, November 2, 2014

SharePoint back basics – move site collection to another content Database using PowerShell commands

Yes, we can move SharePoint site collection form one content DB to another Content database. But before moving the database we need to check following things,
  • New content database should be exists on the same server and it needs to be under the same web application.
  • The account used to move the site collection should be WSS_ADMIN_WPG group and account need to have db_owner permissions.

Before moving the content Db we have verify the size of the DB by using following command,

$spaceUsedinDB = (Get-SPSiteAdministration -Identity (SiteCollection URL).DiskUsed
$spaceUsedinDB

To move the site collection to the new content DB create a new content DB in SharePoint central Admin by navigating to Application management -> Manage Content Database -> Create new Content Database




Run following command in SharePoint management shell,

Move-SPSite SiteCollection URL -DestinationDatabase Target_Content_DB_Name

This operation will take time depending on the site collection size. 

Share this