SQL SERVER Hosting :: How to Dismount and Mount SharePoint 2010 Content Databases For SQL Server Move

Hi guys today I will explains article about How to Dismount and Mount SharePoint 2010 Content Databases For SQL Server Move. 

Consider a scenario where the drives in SQL Server are running out of space and the SQL Server is heavily used. So you decided to move some of the content databases to another SQL Server and attach it back to SharePoint. This can be done manually, but consider a case where you want to move hundreds of content databases. This article explains how to do it with a PowerShell script.

Planning to move Content databases

Before moving the content databases you must plan how to execute it. Find the activities at the following high level:

  • Capture content database details (the content databases to be moved)
  • Detach the content database from the SharePoint web application
  • Inform SQL admin to move the content database to the new SQL Server
  • Attach the content database to the SharePoint web application

Please use the following procedure to do the successful movement of content databases to another SQL Server and attaching them back to a SharePoint web app.

Step 1

Before the actual move of the content database, you must capture the details of the content database first. The following piece of code will help in capturing details like:

  • Content database name
  • Web application URL with which it is attached
  • Content database ID
  • Content database status
  • Database server
  • Total site count on the content database
  • Warning site count
  • Maximum site count

The preceding code requires an input file (DBDetails.csv) placed under the same location where the PowerShell script exists. The input file should have names of the content databases that need to be moved to a new SQL Server.

The script captures the preceding said information and export it to a CSV file (CDBDetails.csv). This output file will be used as an input file for another function.

Step 2

Now you have successfully captured the content databases info. The next step would be to detach the content databases from SharePoint.
The following piece of code helps in detaching the content databases from SharePoint:

The preceding code uses the output file (CDBDetails.csv) that was generated in Step 1 as an input file. It uses the content database name to detach from SharePoint.

Step 3

Now the content databases are successfully detached from SharePoint. Inform the SQL DBA to move the content databases to the new SQL Server.

Step 4

Attach the content databases back to SharePoint once you get confirmation from the SQL DBA that Step 3 is completed.
The following piece of code helps you to attach the content database to SharePoint with the new SQL Server information:

 The preceding code gets input from the user of the new SQL Server name and it uses the output file from Step 1 as an input file to set the same settings for the content databases when adding it back to SharePoint.

Complete Code

Execution Procedure

Step 1

The first step is to populate the input file (DBDetails.csv) with the list of content database to work with. Place the input file under the same location where the PowerShell script is placed.

Step 2

Launch the SharePoint management shell.

Step 3

Navigate to the path where the script is placed.

Step 4

Execute the PowerShell script.

The script gives you the following 3 options to choose from.

  1. Capture the content database details before detaching it
  2. Detach the content database from SharePoint.
  3. Attach the content database back to SharePoint after the SQL Server move.
  • First you need to enter “1” to capture the details for the content database. This information will be used to attach the content database back to SharePoint with the same settings.
  • Second enter “2” to actually dismount the content databases from SharePoint.
  • Third enter “3” to attach the dismounted content database back to SharePoint once the SQL Server move is completed. This option prompts you to enter the new SQL Server details.

Conclusion

Thus in this article I have explained how to dismount and mount SharePoint content databases for a SQL Server move using a PowerShell script.

Best Recommended SQL SERVER Hosting

ASPHostPortal.com

ASPHostPortal.com is Perfect, suitable SQL SERVER hosting plan. ASPHostPortal  the leading provider of Windows hosting and affordable SQL SERVER Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability.

HostForLIFE.eu

HostForLIFE.eu guarantees 99.9% uptime for their professional SQL SERVER 2014 hosting and actually implements the guarantee in practice. HostForLIFE.eu is the service are excellent and the features of the web hosting plan are even greater than many hosting. HostForLIFE.eu offer IT professionals more advanced features and the latest technology. HostForLIFe Best , Cheap SQL SERVER 2014 Hosting, Relibility, Stability and Performance of  servers remain and TOP priority. Even basic service plans are equipped with standard service level agreements for 99.99% uptime. Advanced options raise the bar to 99.99%. HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24×7 access to their server and site configuration tools.

DiscountService.com.au

DiscountService.com.au is The Best and Cheap SQL SERVER Hosting. DiscountService.com.au was established to cater to an under served market in the hosting industry web hosting for customers who want excellent service. DiscountService.com.au guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability. DiscountService.com.au has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch. DiscountService.com.au is devoted to offering the best Windows hosting solution for you