SharePoint 2013 Newsfeed does not show old entries after server crash

A couple of days ago I had an interesting problem with the MySite newsfeed in SharePoint 2013. The SharePoint farm crashed because of a problem with the SAN storage that contains the SharePoint databases. The operation team fixed the problem and I rebooted the SharePoint servers to bring the farm back. Everything looked fine after the reboot, the SharePoint farm was online again.

After some testing I found out that the MySite newsfeed only contained information that was created after the server reboot. All entries that were created before the crash disappeared.
My first idea was that there must be a problem with the microfeed list in the MySite of the users so I checked the list (MySite/Lists/PublishedFeed) on the MySites of some users and found all old entries are still there, they just do not show up in the newsfeed. So my second idea was to check the distributed cache service and the cache cluster. I executed the following PowerShell command on every SharePoint server that has the distributed cache service running:

Use-CacheCluster

Get-CacheHostConfig –ComputerName $env:Computername -CachePort 22233

Get-CacheHost

The cmdlets were executed without any errors, both cache server instances were up and running. I recreated the cache cluster just to make sure that it was possible to create a new cache cluster without any problems. That also succeeded.

The next idea was to look for a PowerShell cmdlet that re-caches the news feed from the micro feed list and I found the following two cmdlets:

Update-SPRepopulateMicroblogLMTCache

Update-SPRepopulateMicroblogFeedCache

 

I started Update-SPRepopulateMicroblogLMTCache with the id of the User Profile Service application proxy one time like this:

$upp = Get-SPServiceApplicationProxy | where {$_.TypeName -like "User Profile Service Application Proxy"}

$uppID = $upp.Id

# Force a cache time stamp refresh

Update-SPRepopulateMicroblogLMTCache -ProfileServiceApplicationProxy $uppID

 

After that I executed the second command with the id of the User Profile Service application proxy and my own account name (domain\username):

$upp = Get-SPServiceApplicationProxy | where {$_.TypeName -like "User Profile Service Application Proxy"}

$uppID = $upp.Id

Update-SPRepopulateMicroblogFeedCache -ProfileServiceApplicationProxy $uppID -AccountName $domainAndUserName

 

And voila: After a couple of seconds and a reload of my MySite page all my old newsfeed entries were back again!

I wrote a PowerShell script that iterates through all of the users with a MySite and executes the Update-SPRepopulateMicroblogFeedCache cmdlet with the account name of the user as parameter. After some minutes all news feeds were repopulated with the old news feed entries.

The cause for this problem was the ungraceful shutdown of all distributed cache instances. This crash killed the in memory cache with the news feed entries.

Repopulate-Newsfeed.zip