SharePoint 2013: Site in Read only mode after an interrupted backup using Backup-SpSite

I came across an interesting issue recently where a customer was backing up a site collection via SharePoint Management shell using the Backup-spsite.  The backup process was abnormally terminated. This resulted in the Site being in Read only mode and the following message would show up when users browsed to the site.

“We apologize for any inconvenience, but we’ve made the site read only while we’re making some improvements.”

clip_image001

Possible Solutions:

Under Site Collection Quotas and locks, set the database back to Not locked and save your settings which didn’t work for me.

You can also run the following command in powershell to set this attribute:

stsadm -o setsitelock -url http://server_name -lock none which didn’t work for me.

Go to “Site collection Quota & locks” in Central Admin and here is how the Status looks like. It is locked as “Read only” & all settings were grayed out. So I couldn’t select the Not Locked option.

If you are running an older version try this solution.  Another method has worked for me in Central Administration >Quotas & Locks apply (or in this case re-apply) the option to lock the file or even no access and then toggle it back to unlock and it has worked for me to release the file back to read/write mode

clip_image003

Solution: Here is more on this behavior & how to get out of this situation which ONLY worked for me

In SharePoint 2013, we introduced a property MaintenanceMode for Spsite object which indicates the site is undergoing a Maintenance & is read only. SPSite.MaintenanceMode flag can be set on a site for several reasons like content database is in read only state, or site collection is being upgraded, backed up or moved.

If a site gets into a state where the action that set this has terminated in a way where this is still set, we run into this situation.

The way to clear this flag is use the ClearMaintenanceMode method in SpSiteAdministration object. Here is how it can be done via SharePoint Management Shell

————————————————

# $Admin = new-object Microsoft.SharePoint.Administration.SPSiteAdministration(‘http://weburl/sites/sitecollectionurl’)

$Admin.ClearMaintenanceMode()

————————————————-

The SpsiteAdministration.ClearMaintenanceMode method was introduced in April 2013 CU for SharePoint 2013. So you would need to upgrade the environment to March 2013 & April 2013 update available at Update Center for SharePoint 2013

Article from: https://blogs.msdn.microsoft.com/spses/2013/05/16/sharepoint-2013-site-in-read-only-mode-after-an-interrupted-backup/