Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

 

Streamling the SharePoint Update Process to Reduce Downtime


By:   |   Read Comments   |   Related Tips: > Sharepoint

Attend this free live MSSQLTips webcast

Tips and Tricks to Growing Your SQL Server Estate from SMB to Enterprise Scale
Thursday, June 28, 2018 - click here to learn more


Problem

Microsoft has improved the quality and frequency of updates for SharePoint since MOSS 2007 was released by using cumulative updates. However, as a SharePoint Administrator, you'll have to deal with downtime while these updates install. Some updates may even require reboots, disconnecting from the farm and running PSConfig (also known as the SharePoint Products and Technologies Wizard). Because some updates make changes at the database level, having very large databases will potentially cause hours of downtime for the entire farm.

Solution

Luckily, we have a trick that can be used to apply updates more quickly and isolate large content databases so they aren't holding up everyone else. This procedure involves detaching any large content databases, applying the updates, and then re-attaching the content databases. Since the databases will not be visible to SharePoint, no updates will be applied to them until they are re-attached. Let's look at a few ways to do this.

Manual Procedure

This is the procedure to use at first and ensure no mistakes are made.

  1. First, record the names of the content databases you will detach for each Web Application.
  2. Execute the command to detach the content database(s).
    • For SharePoint 2010, use PowerShell: Dismount-SPContentDatabase "<ContentdBName>"
    • For SharePoint 2007, use STSADM: stsadm.exe -o deletecontentdb -url <WebApplicationUrl> -databasename <ContentdBName> -databaseserver <DatabaseServerName>
  3. At this point, the databases are detached and we can run the update(s). Run the patch, update, Cumulative Update, or Service Pack as your normally would.
  4. You will probably be required to run PSConfig (the SharePoint Products and Technologies Wizard) so do that before moving on. Once that's complete, your SharePoint Farm is operational and is only missing the content database(s) that were detached earlier.
  5. Finally re-attach the content database(s).
    • For SharePoint 2010, use PowerShell: Mount-SPContentDatabase "<ContentDb>" -DatabaseServer "<DbServer>" -WebApplication http://SiteName
    • For SharePoint 2007, use STSADM: stsadm.exe -o addcontentdb -url <WebApplicationUrl> -databasename <ContentdBName> -databaseserver <DatabaseServerName>

Scripted Procedure

Mattias Karlsson has written a script that will perform some of these manual steps for you. If you're dealing with a smaller farm, the manual procedure will probably be faster. However, if you're dealing with several farms and many content databases, this script may have the advantage.

  1. Head over to Mattias' blog to download a copy of SP-Upgrade script: http://mysharepointofview.com/downloads/
  2. Next create a folder named "Media" and place the script there. When extracted, the script file is named SP-Upgrade.ps1. Since we are likely doing this because we have a lot of servers, create this on a file share accessible to all servers.
  3. Download and extract the updates to the "Media" folder. An example of extracting updates, can be found on the MSSharePointTips.com article: Slipstream Office SharePoint Server 2007 Service Packs.
  4. Rename the .exe files in the "Media" folder so that they begin with a digit representing the order in which they should be installed.
  5. On the SharePoint Server, open PowerShell and type: SP-Upgrade -Binaries -DetachContentDBs
  6. The previous command detaches content databases and installs the updates. After it's finished, you'll need to run PSConfig and re-attach the content databases: SP-Upgrade -PSConfig -AttachContentDBs

Although this procedure takes a bit longer to setup, it can save a lot of time if you have a large SharePoint Farm or multiple SharePoint Farms.

Using these procedures will allow you to restore SharePoint services to most of your users, leave only the "data hogs" to wait for their upgrade.

Next Steps


Last Update:


next webcast button


next tip button



About the author
MSSQLTips author Wahid Saleemi Wahid Saleemi

View all my tips





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools