Category Archives: patching

configuration cache clearing sharepoint 2019 step by step

in this post we will discuss how configuration cache clearing sharepoint 2019 is done in on-premise environment step by step. clearing configuration cache involves below steps

  • Stop the sharepoint “SharePoint Timer Service (SPTimerV4)” “.
  • Delete all files of type “XML Document” from “Config” folder.
  • Take Back up of file “cache.ini” file.
  • Edit the value present in the file “cache.ini” and save.
  • Restart timer job “SharePoint Timer Service (SPTimerV4)“.

Stop timer job service SharePoint Timer Service (SPTimerV4)

first you need to stop the timer job service “sharepoint timer serivce (SPTimerV4)“. You can stop the timer service either directly opeining from services or you can use powershell command to stop sharepoiint timer service job.

Open “Run” from windows server or click button “Windows + R” to open “Run“.

how to open services.msc from windows server 2019
open services.msc

identifty the timer job “SharePoint Timer Service (SPTimerV4)“. Right click on the timer job, click on “Stop“.

how to stop services sharepoint timer services SPTimerV4
stop services sharepoint timer services

you can stop timer job “SharePoint Timer Service (SPTimerV4)” using powershell command as well. Open sharepoint timer services preoperties.

sharepoint timer services preoperties
sharepoint timer services preoperties

Open “Windows Powershell ISE” as an administrator and enter the command below to stop services.

Stop-Service -Name SPTimerV4
stop-service using powershell
stop-service using powershell

Navigate to sharepoint configuration cache location “C:\ProgramData\Microsoft\SharePoint\Config“. There will be one folder under which cache files will be there. click on that folder as per the screenshot below.

sharepoint configuration cache location

Delete all “XML Document” files present in that folder except “cache.ini“.

delete configuration cache files sharepoint
Delete configuration cache files (XML Document)

Open the file “cache.ini” and edit value to “1” and “Save” the file.

edit the vluse present under file cache
Edit the vluse present under file cache

Restart the timer job now which will recreate the cache files. Run the below command so as to start sharepoint timer service.

Start-Service -Name SPTimerV4
start-service
start-service

Cache files will be recreated in the folder “Cache”.

configuration cache created again

Configuration Cache Clearing SharePoint 2019 | #SharePoint, #SharePoint2019, #ConfigCache

Configuration Cache Clearing SharePoint 2019 | #SharePoint, #SharePoint2019, #ConfigCache

Advertisements
Patching SharePoint Server 2013

Patching SharePoint Server 2013 step by step

Patching SharePoint Server 2013 step by step

Patching SharePoint server 2013 is one of the most difficult task that everyone want to know how to implement step by step. Watching this video, you will feel like its very easy to implement, but truly its equally risky. So careful while implementing the steps. Watch the below video for details. SharePoint 2013 patching best practices is followed here also how to run psconfig (sharepoint configuration wizard steps) after patching is shown in the video.

  • Download the KB   (sharepoint 2013 cumulative update/Patch download link)from the URL as shown in the video.
Patching SharePoint
  • Extract files after download and you will find 3 files of extension “.exe , .cab, .cab”.
Patch 1321x705
  • Copy this below code to notepad and save as in “.ps 1”
########################### 
##Ensure Patch is Present## 
########################### 
$patchfile = Get-ChildItem | where{$_.Extension -eq ".exe"}
if($patchfile -eq $null)
{
  Write-Host "Unable to retrieve the file.  Exiting Script" -ForegroundColor Red
  Return
}

######################## 
##Stop Search Services## 
######################## 
##Checking Search services##
$srchctr = 1
$srch4srvctr = 1
$srch5srvctr = 1
$srv4 = get-service "OSearch15"
$srv5 = get-service "SPSearchHostController"

If(($srv4.status -eq "Running") -or ($srv5.status-eq "Running"))
  {
    Write-Host "Choose 1 to Pause Search Service Application" -ForegroundColor Cyan
    Write-Host "Choose 2 to leave Search Service Application running" -ForegroundColor Cyan
    $searchappresult = Read-Host "Press 1 or 2 and hit enter"
    Write-Host
   
   if($searchappresult -eq 1)
    {
        $srchctr = 2
        Write-Host "Pausing the Search Service Application" -foregroundcolor yellow
        Write-Host "This could take a few minutes" -ForegroundColor Yellow
        $ssa = get-spenterprisesearchserviceapplication
        $ssa.pause()
    }

    elseif($searchappresult -eq 2)
    {
        Write-Host "Continuing without pausing the Search Service Application"
    }
    else
    {
        Write-Host "Run the script again and choose option 1 or 2" -ForegroundColor Red
        Write-Host "Exiting Script" -ForegroundColor Red
        Return
    }
  }

Write-Host "Stopping Search Services if they are running" -foregroundcolor yellow
if($srv4.status -eq "Running")
  {
    $srch4srvctr = 2
    set-service -Name "OSearch15" -startuptype Disabled
    $srv4.stop()
  }

if($srv5.status -eq "Running")
  {
    $srch5srvctr = 2
    Set-service "SPSearchHostController" -startuptype Disabled
    $srv5.stop()
  }

do
  {
    $srv6 = get-service "SPSearchHostController"
    if($srv6.status -eq "Stopped")
    {
        $yes = 1
    }
    Start-Sleep -seconds 10
  }
  until ($yes -eq 1)

Write-Host "Search Services are stopped" -foregroundcolor Green
Write-Host 

####################### 
##Stop Other Services## 
####################### 
Set-Service -Name "IISADMIN" -startuptype Disabled
Set-Service -Name "SPTimerV4" -startuptype Disabled
Write-Host "Gracefully stopping IIS W3WP Processes" -foregroundcolor yellow
Write-Host
iisreset -stop -noforce
Write-Host "Stopping Services" -foregroundcolor yellow
Write-Host
$srv2 = get-service "SPTimerV4"
  if($srv2.status -eq "Running")
  {$srv2.stop()}

Write-Host "Services are Stopped" -ForegroundColor Green
Write-Host
Write-Host 

################## 
##Start patching## 
################## 
Write-Host "Patching now keep this PowerShell window open" -ForegroundColor Magenta
Write-Host
$starttime = Get-Date
$filename = $patchfile.basename
Start-Process $filename
Start-Sleep -seconds 20 
$proc = get-process $filename
$proc.WaitForExit()
$finishtime = get-date
Write-Host
Write-Host "Patch installation complete" -foregroundcolor green
Write-Host 

################## 
##Start Services## 
################## 
Write-Host "Starting Services Backup" -foregroundcolor yellow
Set-Service -Name "SPTimerV4" -startuptype Automatic
Set-Service -Name "IISADMIN" -startuptype Automatic

##Grabbing local server and starting services##
$servername = hostname
$server = get-spserver $servername

$srv2 = get-service "SPTimerV4"
$srv2.start()
$srv3 = get-service "IISADMIN"
$srv3.start()
$srv4 = get-service "OSearch15"
$srv5 = get-service "SPSearchHostController"

###Ensuring Search Services were stopped by script before Starting"
if($srch4srvctr -eq 2)
{
    set-service -Name "OSearch15" -startuptype Automatic
    $srv4.start()
}
if($srch5srvctr -eq 2)
{
    Set-service "SPSearchHostController" -startuptype Automatic
    $srv5.start()
}

###Resuming Search Service Application if paused### 
if($srchctr -eq 2)
{
    Write-Host "Resuming the Search Service Application" -foregroundcolor yellow
    $ssa = get-spenterprisesearchserviceapplication
    $ssa.resume()
}

Write-Host "Services are Started" -foregroundcolor green
Write-Host
Write-Host
Write-Host "Script Duration" -foregroundcolor yellow
Write-Host "Started: " $starttime -foregroundcolor yellow
Write-Host "Finished: " $finishtime -foregroundcolor yellow
Write-Host "Script Complete"
  • Save all files that is of extensions “.exe , .cab, .cab, .ps 1” in one folder.
Patching SharePoint Server
  • Open “SharePoint Management Shell”.
  • Navigate to the folder in which all files are stored and run the Powershell script.
  • Next step is to run the config wizard. Please find the video in detail step by step further.

how to run sharepoint configuration wizard steps (psconfig)