How to update SharePoint Template with minimum downtime

Make sure you have sufficient rights on the SharePoint database. E.g. farm account. Also check to see if there is enough space left on the hard disk to store the backup.

 

Scenario 1

Update

Since the update of the SharePoint TemplateSettings and Content Management for Anywhere365, based on SharePoint server or SharePoint Office 365 can take a while (up to many hours), it can be very useful to start the update within Business Hours and so minimize the downtime.

The scenario below requires a ‘Change Stop’ for UCCUCC stands for Unified Contact Center and consists of a queue that can be handled by Agents Each Contact Center has its own settings, interactive voice response questions and Agent with specific skills. Agents can be member of, or sign up to, one or more Contact Centers. configurations. By modifying the Hosts file (or stopping the SharePoint IIS Site) you make sure the UCC cannot contact the SharePoint configuration pages and therefore runs with the current configuration set.

This scenario can only be used if the SharePoint server is a different server than the UCC server.

  1. On the UCC server, open notepad as administrator and open the hosts file from:

C:\Windows\System32\drivers\etc\

  1. Modify the file, so that the SharePoint URL points to localhost

  1. Save the file
  2. In CMD, run ipconfig /flushdns
  3. You will now notice that the UCC log shows error about SharePoint connectivity
  4. Which is good in this case
  5. Logon to the SharePoint server and download Microsoft ULS Viewer
    https://www.microsoft.com/en-us/download/details.aspx?id=44020
  6. Copy over the latest SharePoint Template files
  7. Open SharePoint 2010 / 2013 Management Shell as “Administrator”
  8. Make a Backup via:
Backup-SPSite http://URLofSiteCollection -Path C:\Backup\backup.bak
  1. A back-up is now created and placed in the given location.
  2. Direct to the path of where the install file is located
  3. Run the install script to start the update (sptemplate_install.ps1)
  4. When prompted, choose ‘install’

During the update process, not much logging in Powershell can be seen. The logging during the update can be found in SharePoint's own ULS logs. Use ULS Viewer (download from Microsoft) to view the logging in real-time. Important update messages can be filtered via the following:

“Category contains WSP”

 

Rollback

  1. Open SharePoint 2010 / 2013 Management Shell as “Administrator”.
  2. Type in the following command line and hit enter:

Restore-SPSite http://URLofSiteCollection/ -Path C:\Backup\backup.bak -force -DatabaseServer databaseserver -DatabaseName databasename -confirm:$false

 

Scenario 2

This scenario can be used when you are comfortable with SharePoint Central Administration and SQL. The scenario consists of 2 parts, where part 1 can be done during business hours of the UCC. Part 2 needs to be taken care of when the UCC service is stopped.

 

Part one

  1. Create a backup of the SharePoint Content Database, by using SQL Management Studio
  2. Create a local backup of all UCC configuration sites using the Anywhere365 CopySettings script
  3. Break the connection between the UCC service and the SharePoint server.
    1. On the UCC server, open notepad as administrator and open the hosts file from:

      C:\Windows\System32\drivers\etc\

    2. Modify the file, so that the SharePoint URL points to localhost
    3. Save the file
    4. In CMD, run ipconfig /flushdns
  4. Detach the current SharePoint content database via the remove option in SharePoint Central Administration
  5. Create a new SharePoint site collection and attach a new SharePoint Content database.
  6. Install the new Anywhere365 SharePoint Template
    1. Open SharePoint Management Shell as “Administrator”
    2. Start Install Script
    3. Choose between Install, Uninstall, Activate or Deactivate.
    4. Choose if you want the script to show a list of available site collections or that you want to manually enter the URL of the site collection.
    5. When there are multiple site collections available the install script will show a list of the (numbered)site collections. Select the number of the site collection where the Template needs to be deployed.
    6. The template will be installed.
    7. If the installation is finished, a list with UCC setting sites within the selected site collection will be displayed followed by version number. If you have selected multiple site collections you see multiple lists.
    8. If there are no UCC settings sites (yet) you get the message: WARNING: No UCC Setting sites found in this site collection.
    9. If you have not enough permissions on the site collection to execute the version check you get the message: No UCC Setting sites can be accessed in this site collection. You must be a Site Collection Administrator.
    10. Close the management shell
  7. Recreate all UCC configuration sites via the Anyhere365 CopySettings script.

 

Part two

  1. Stop the UCC service
  2. On the UCC server: Open Notepad as administrator
  3. Open 'hosts' file, which can be found in C:\Windows\System32\drivers\etc
  4. Place a # for the line you created in step 3
    1. The line will no longer be used
  5. Save the file
  6. Delete the the UCC cache folders
  7. Start the UCC service

 

Rollback

In the case something goes wrong, trouble shoot first to find the issue. This is usually faster then the rollback.

  1. Stop the UCC service
  2. Remove the UCC cache folders
  3. "Detach" the new SharePoint content database by remove in the Central Admin
  4. Open Central Admin
  5. Go to Application Management
  6. Go to Manage Content Databases
  7. Click on WSS_Content_Anywhere365 (this is the new database)
  8. Mark the Remove content database and select OK
  9. "Attach" the old SharePoint contact database by adding it using Central Admin.
  10. Go to Add a content database
  11. Enter Database Server
  12. Enter Database Name
  13. Leave the rest as is and select OK
  14. Run the Install of the old SharePoint template script on the site collection
  15. Start the UCC service