Friday, May 17, 2013

Attach or detach content databases in SharePoint 2010/2013 using Powershell

To attach an existing content database:
 
Mount-SPContentDatabase "contentdbname" -DatabaseServer "SQLserver" -WebApplication http://SiteName

Where:
  • is the content database to be attached.
  • is the name of the database server.
  • http://SiteName is the name of the web application to which the content database is being attached.

To detach a content database:

Dismount-SPContentDatabase "contentdb name" 
Where is the name of the content database.

No comments:

Post a Comment