Reset the Sharepoint Configuration Cache manually

Applies to: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Here are five simple steps to clear (reset) the SharePoint configuration cache on a SharePoint server. Perform the steps on a single or multiple servers if necessary. Each step can be done via graphical interface or using the provided PowerShell commands.

1. Stop The Timer Service

PowerShell
Stop-Service -DisplayName "SharePoint Timer Service"

2. Identify the configuration cache folder

Open the following folder: C:\ProgramData\Microsoft\SharePoint\Config

You may have to start by opening C:\ and clicking through all the folders in order to gain access to it.

There may be several folders inside it as in the screenshot below. The correct folder is usually the one which has been currently modified.

You can also identify the correct folder by checking the configuration database GUID. The name of the config folder is equal to the GUID.

Get the config DB GUID via PowerShell.
PowerShell
Get-SPDatabase | Where-Object {$_.Type -eq "Configuration Database"} | select name,id | Format-List

3. Delete the xml files

Delete all the .xml files in the folder, do not delete the cache.ini file!

PowerShell
$ConfigDBGuid = (Get-SPDatabase | Where-Object {$_.Type -eq "Configuration Database"}).id.guid
$XMLFiles = Get-ChildItem C:\ProgramData\Microsoft\SharePoint\Config\$ConfigDBGuid -Filter "*.XML"
$XMLFiles | Remove-Item

4. Set the cache.ini content to 1

PowerShell
$ConfigDBGuid = (Get-SPDatabase | Where-Object {$_.Type -eq "Configuration Database"}).id.guid
$Cache_ini = Get-Item "C:\ProgramData\Microsoft\SharePoint\Config\$ConfigDBGuid\cache.ini"
Set-Content -Path $Cache_ini -Value "1"

5. Start the SharePoint Timer Service.

PowerShell
Start-Service -DisplayName "SharePoint Timer Service"

Potential Issues

Central Administration Site

After cleaning up the configuration cache on servers running the central administration, you might experience temporary side effects when you open the central admin page, for example web applications might be missing in central administration but also other weird things…just give the servers some time to load the configuration from he database and then reopen the CA, the issues will gradually go away.

Performance

If you stop the timer service on all the servers at the same time, then clean up the cache on all of them and then start the timer service on all of them, all these servers will start loading the configuration from the database at the same time which might have impact on the performance until the configuration is loaded. Therefore you should consider doing it one server at a time.

Search Service Application

If you have issues with SSA, resetting configuration cache might help you but also might make it worse. We had issues with one of two SSAs – crawls were not working. After the reset, both SSAs had the same issue and we had to remove all the search components and then add them back again to fix the SSA.

Leave a Reply

Your email address will not be published. Required fields are marked *