Thursday, 16 June 2016

Query Server Not Responding or Query Component Not Responding in SharePoint Search

Query Server Not Responding or Query Component Not Responding in SharePoint Search
Background : SharePoint Search new data is not getting crawled and the full & Increment crawling is never-ending.
Exception : Search Administration page
Propagation Status : Query server not responding(Guid – query-1)
Search Application Topology : Query Component Not Responding
Crawl Log :The server is unavailable and could not be accessed. The server is probably disconnected from the network.
Root Cause : When the query component is not responding then the SharePoint Search will not crawl the new content from the sites and it will not search the data from the new content sources created. Hence, the crawling status will not change.
Workaround : Before the general workarounds you can try different methods.
if you are fine with Search downtime and Index Reset, Please proceed with Method 1
Method 1 : Restart the Search Server Service
Restart the Search Server Service , Execute the below command on effected query server
stsadm -o osearch -action stop
stsadm -o osearch -action start -role query
if problem persists check the permissions of Index Folder, Ensure WSS_ADMIN_WPG, IIS_WPG has permission on this folder
You can find the location of index folder in Search Application Topology,Query Component>> Edit properties
General Location of Index. : C:\Program Files\Microsoft Office Servers\14.0\Data\Office Server\Applications
If the WSS_ADMIN_WPG, IIS_WPG don’t have read & execute access in Applications folder,Please grant read and execute permissions and check whether the issue resolves. If till issues persists please try Method 2
Method 2 : Change Index file Location
STSADM.exe –o osearch –propagationlocation “C:\NewLocationPath”
if the issue didn’t solve after executing the above command, please try Method 3
Method 3: Add a new query component
On the SharePoint Central Administration Web site, click General Application Settings and in the Search section click Farm Search Administration.
In the Search Service Applications section, from the list select the search service application that generated the event, and then click Modify Topology.
On the Topology for Search Service Application page, click the failed query component in the topology list, and then select Add Mirror from the component’s drop-list.
In the Add mirror query component dialog box, select the query server and associated metadata database for the new query component, and then click OK.
Click Apply Topology Changes. The changes are processed for the search application and the index is copied from the failed query component to the new query component.
Click the failed query component and click Delete.
The topology removes the index from the failed query component and deletes the component.
You can able to fix this issue using any one of above methods

Backup and Restore Site/Sub site list/document library in SharePoint

Backup and Restore Site/Sub site list/document library in SharePoint
Backup a sub site using power shell: Use export-spweb command to take sub site backup
Export-SPWeb -Identity "<subsite URL>" -Path "<directory\test.cmp>" -IncludeUserSecurity -IncludeVersions all
Restore a sub site using power shell: Use import-spweb command to restore sub site from backup
Import-SPWeb <subsite> URL -Path "<directory\test.cmp>" -Force -IncludeUserSecurity
------------------------------------------------------------------------------------------------------------------------------
Backup a List/Doc Library: use below export command to take list/doc library backup
Export-SPWeb -Identity <Site Collection URL> -Path <path and file name> -ItemURL "/Lists/list or Document library name" [-IncludeUserSecurity] [-IncludeVersions] [-NoFileCompression]
Restore a List/Doc Library: use below export command to restore list/doc library from backup

Import-SPWeb -Identity <Site Collection URL> -Path <path and file name> [-Force] [-NoFileCompression]

SQL querry to get the Database sizes

SQL query to get the Database sizes 
Use below SQL Script to get all DB sizes in MB
----------------------------------------------------------------------------------
SELECT d.name,
ROUND(SUM(mf.size) * 8 / 1024, 0) Size_MBs
FROM sys.master_files mf
INNER JOIN sys.databases d ON d.database_id = mf.database_id
WHERE d.database_id > 4 -- Skip system databases
GROUP BY d.name
ORDER BY d.name
-----------------------------------------------------------------------------------
You will get the .csv output by executing the query, the DB size will be in MB you can convert into GB

How to find SharePoint is connect SQL

How to find SharePoint is connect SQL
Use below Powershell command to check whether SharePoint is connected to SQL
Get-SPFarm
Use below Telnet command to check the connectivity between SharePoint and SQL
telnet {SQL-Server-Name or IP} 1433
Example: telnet mysharepoint 1433

PowerShell script to get site ID's in site collection

PowerShell script to get site ID's in site collection
‪#‎Script‬ to get site ID's in a site collection.
ADD-PSSnapin Microsoft.SharePoint.Powershell -erroraction silentlycontinue
Add-Type @'
public class SiteDetails
{
public string SiteId;
}
'@
$itemsColl = New-Object 'System.Collections.Generic.List[System.Object]';
‪#‎Site‬ URL
$siteurl=Read-Host "Enter Site URL"
$Site=Get-SPSite $siteurl
$spWebApp = $Site.WebApplication
foreach($allsites in $spWebApp.Sites)
{
$EvItem = New-Object SiteDetails
$EvItem.SiteId = $allsites.ID
$itemsColl.Add($EvItem);
}
$itemsColl | export-csv SiteReport.csv -noType

For more information about SharePoint visit MySharepoint

Making replica of a document library or list using SP designer

Making replica of a document library or list using SP designer

First create 2 document libraries to perform this operation, So just create Project Documents as a source document library & Shared Documents as a Destination document library

Step:1 Open site/site collection in SP designer















Step-2: Crete a Workflow in SP designer
In the left side panel click on “workflows” then select “list workflows”















Select Technology documents as a source document library












Enter the name as “File backup” click “OK”















Go to “Action” select Copy items



















Select to “which list” as “current item”







Select  “this list” as “Shared Documents”






After this click on “Save” and then click on “Check for errors”









Click on the workflows select “File backup” workflow






Check “Start automatically when an item is created” option then click om “Publish”



















Adding the documents to destination Document library & check for replica operation is working or not
Go to Technology Document library then add documents then wait for few minutes then check in Shared Document library the same documents you can find.

For more information about SharePoint visit MySharepoint

Basic Terms in SharePoint Search

Basic Terms in SharePoint Search
Search Topology
It is a combination of several topology components, all of which provide specific functionality required for Search to operate.
---------------------------------------------------------------------------------

What is crawling?
Crawling is the process that the SharePoint Server uses to access the data within the content source and build the search index.
Once a content source has been defined within the system, an administrator can define specific schedules by which the content will be crawled.
-----------------------------------------------------------------------------------
What is index?
An index is the location that contains details on all the information in the content sources. When users perform searches, the index is queried for content that matches the user-entered terms.
The index is comprised of both the metadata and content of the files contained within the system.
-----------------------------------------------------------------------------------
What is query?
When you conduct a search by entering a keyword or phrase into one of the available search boxes,you are creating a query.
This query will be performed against the content index to identify content that contains a match for a keyword or phrase that you have entered.
The search system will return a listing of items that match your query. These are referred to as search results.
-----------------------------------------------------------------------------------
How the Search Results work?
For the search you conducted, you entered a search query in the search box. The search query was conducted against the search index, and all SharePoint content that contained the term “sales”
was returned as part of the search results.