Attach or detach content databases in SharePoint 2013/2016

This SharePoint tutorial explains, how to attach or detach content databases in SharePoint 2013/2016 using PowerShell or by using SharePoint central administration.

We can attach or detach a content database using SharePoint Central Administration or by using PowerShell commands.

Attach content database using SharePoint Central Administration

Follow the below steps to attach a content database using SharePoint central administration.

First Open SharePoint Central Administration, then click Application Management.

On the Application Management page, in the Databases section, click Manage content databases.

On the Manage Content Databases page, click Add a content database.

This will open the Add Content Database page. Here in this page:

  • We need to select a particular web application.
  • We need to specify the database server.
  • Database Name, And the authentication mode and if you are using Sql Server authentication mode then we need to give the account name and password.

Then Click on OK.

Detach content database using SharePoint Central Administration

Follow the below steps to detach content database using SharePoint central administration.

First Open SharePoint Central Administration, then click Application Management.

On the Application Management page, in the Databases section, click Manage content databases.

Then select the web application for which you want to detach a content database.

Click the content database that you want to detach.

On the Manage Content Database Settings page, select the Remove content database checkbox.

Then click on OK. Then this will ask for Confirmation and then click on OK again.

Attach content database using PowerShell

We can also easily attach a SharePoint content database using PowerShell.

First Open PowerShell and run the below command:

Mount-SPContentDatabase "<ContentDb>" -DatabaseServer "<DbServer>" -WebApplication http://SiteName

Detach content databases using PowerShell

We can also detach a content database using PowerShell in SharePoint.

First Open PowerShell and run the below command:

Dismount-SPContentDatabase "<ContentdBName>"

You may like following SharePoint tutorials:

Here, in this SharePoint tutorial, we learned how to attach or detach content databases in SharePoint 2013/2016.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>