Thursday, December 26, 2013

Setting your SharePoint Farm in Read-Only mode

Listed below are steps to put SharePoint Farm into Read Only mode. You might want to do this activity at the time of cut-over to a new version of SharePoint like 2007 to 2010/2013 upgrade or performing a maintenance activity on the servers to block user traffic etc. Its advisable to put only SharePoint Content databases in Read Only mode during such a cut-over activity, since you might still want other services like User Profile, Search, Managed Metadata, Excel services etc to be operational in the farm.

1. Put all the SharePoint Servers (App, WFE, Search servers) in Maintenance Mode using SCOM/Spectrum

2. Unschedule Search Crawls & User Profile Synch jobs - Do not stop On-going Search Crawls. Let it complete successfully and then un-schedule it. You may choose to keep Search Crawls unscheduled, as there will not be any new content added during Read-Only mode.

3. Unschedule all Windows Task Scheduler Jobs (related to SharePoint). Again do not stop the on-going scheduled jobs and let them complete successfully prior to un-scheduling them.

4. Disable the following Timer Jobs: (You can develop a PowerShell script to programmatically disable the following timer jobs, if they are enabled at webapps. In my case, I did develop a script to disable timer jobs)
Bulk workflow task processing
Change Log
Database Statistics
Dead Site Delete
Disk Quota Warning
Expiration policy
Hold Processing and Reporting
Immediate Alerts
Information management policy
Profile Synchronization
Quick Profile Synchronization
Records Center Processing
Recycle Bin
Scheduled Approval
Scheduled Page Review
Scheduled Unpublish
Search and Process
Shared Services Provider Synchronizing Job
Site Collection: Delete
Usage Analysis
Variations Propagate Page Job Definition
Variations Propagate Site Job Definition
Windows SharePoint Services Watson Policy Update
Workflow
Workflow Auto Cleanup
Workflow Failover
Nintex Workflow Scheduler (if you have Nintex Workflows installed)
Any third party timer jobs related to SharePoint

5. Stop SharePoint 2010 Applications
 @echo Stopping services...
NET STOP SPAdminV4
NET STOP SPTimerV4
NET STOP SPTraceV4
NET STOP SPUserCodeV4
NET STOP SPWriterV4
NET STOP SPSearch4
NET STOP OSearch14
NET STOP "IIS Admin Service"
NET STOP w3svc
NET STOP smtpsvc
@pause

6. DBA to put SharePoint Content in Read-Only mode. A list of Content DBs associated to several site collections can be identified using the following STSADM command:
stsadm.exe -o enumsites -url {WebApp URL} > ".\Report\webappname-$(Get-Date -Format MM-dd-yyyy-HH-mm).xml"

You might also have third party components like Nintex, DocWay etc, databases related to these components should also be put in Read-Only mode.

7. Start SharePoint 2010 Application (Run the Start batch script)
 @echo Starting services...
NET START SPAdminV4
NET START SPTimerV4
NET START SPTraceV4
NET START SPUserCodeV4
NET START SPWriterV4
NET START SPSearch4
NET START OSearch14
NET START "IIS Admin Service"
NET START w3svc
NET START smtpsvc
@pause

8. Disable Kerberos authentication from Default zones/Custom zones

9. Take Servers out of maintenance mode using SCOM/Spectrum

10. Enable User Profile Synch Job and Search Crawls for User Profiles (sps3:mysites)
This would ensure that newly added users during the Read Only period are still available in the Profile and you can access them, if you have custom People Search that could directly access User Profile store.
To ensure newly added users have access to the SharePoint farm for your public facing sites, you would want to have All Authenticated Users permissions set for those intranet/internet facing sites.

11.Smoke Test (Ad-hoc testing on Read Only scenarios)

At the end, you can put all these steps in your Quality center site and run them as Test cases and make it a standardized process.

Next part will cover, Rollback steps and PowerShell script to Disable/Enable Timer jobs