Streamling the SharePoint Update Process to Reduce Downtime

By:   |   Comments   |   Related: > SharePoint Administration


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.


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:
  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 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

sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip

About the author
MSSQLTips author Wahid Saleemi Wahid Saleemi

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips

Comments For This Article

get free sql tips
agree to terms