Tuesday, February 2, 2016

Clearing SharePoint Cache



Abstract

One of the features of SharePoint is that updates made on one server are automatically reflected on all the other servers. This is accomplished by the Configuration cache being duplicated on all the SharePoint servers. When regular operational maintenance is done, sometimes the Application Event Log on one (or more of these servers) will show an error with the ID 6398. This is due to the Configuration Cache being out of sync with the farm. There are many causes for this like DNS issues preventing the server by being contacted by the server where the change is made. Another cause is a failed feature installation that has to be rolled back. Once that is done, the Configuration Cache has to be rebuilt on each of the other SharePoint Servers. While the cause needs to be found and mitigated, the SharePoint Server has to be forced to rebuild the Configuration Cache. This Blog Post will show you how to force the rebuild of the Configuration Cache and has been tested for SharePoint 2013 and SharePoint 2010.

Procedure:

Using Farm Administrator credentials, there are four steps to be done in sequence.

Step 1: Stop the SharePoint Timer Service.

Go to the services screen running on the server. [services.msc from a command prompt]


Right click on the service, select Properties and then click on Stop

 

You will know that the service has stopped when the Service Status says Stopped – the Stop and Pause buttons are grayed out and the Start button is the only option available.

 

Step 2: Delete all the XML files in the Configuration Cache.

Navigate to the “C:\ProgramData\Microsoft\SharePoint\Config\” folder. Note that under normal circumstances you are not going to find the folder because it is a hidden folder. [Brief description on how to unhide the folder – In File Manager click on the drop down arrow next to “Organize” and select “Folder and Search Options”, click the “View” tab, click on the round radio button that says “Show hidden files, folders and drives”, click on “Apply” at the bottom of the screen, click on “Apply to Folders” in the top windows of the screen and then click on “OK”].

Delete everything in the folder except the cache.ini file. Make sure you do not delete the cache.ini file.


 

Step 3: Reset the cache.ini file

Open the cache.ini file with any text editor. There will only be one entry which is some random large number.


Delete the number, put in the number “1”, without quotes and save the file. This will force the Configuration Cache to be rebuilt.

 

Step 4: Start the SharePoint Timer Service

 


Clicking on Start will make the service run. If you go back to the “C:\ProgramData\Microsoft\SharePoint\Config\” folder, you will see XML files starting to populate.

Note: I have found a script on codeplex that does this job. I am a firm believer that before using any utility to do a job you should know how to do it manually. So the steps above are the manual steps. Any updates or comments will be welcome.

1 comment:

  1. Originally published on June 17, 2014 at www.bigapplesharepoint.com - http://www.bigapplesharepoint.com/pages/View-An-Insight.aspx?BlogID=37

    ReplyDelete