Wednesday 29 June 2016

Set All Search boxes to use the search center in SharePoint 2013


In SharePoint Site search boxes will crawl the data from local sites. We can see “Expand your search” link that redirects the search center, whenever we configure the global search center in the application. We can configure the search boxes in site level and site collection level in site settings (Site Settings -> Site Collection Administration -> Search Settings) Site level (Site Settings -> Search -> Search Settings)


















In SharePoint it is always not possible to modify in all the sites and site collections. Steve Mann wrote power shell commands to loop all the site collections and apply search center URL.

$webApp = Get-SPWebApplication “Web Application URL
foreach ($siteColl in $webApp.Sites)
{
    if ($siteColl -ne $null)
    {
        $site = Get-SPWeb $ siteColl.Url      
        $site.AllProperties["SRCH_SB_SET_SITE"] = 
                {"Inherit":false,"ResultsPageAddress":"/sites/SearchCenter/Pages/results.aspx","ShowNavigation":false}'
        $site.AllProperties["SRCH_ENH_FTR_URL_SITE"] = '/sites/SearchCenter/Pages'
        $site.Update();
    }
}

Here SRCH_SB_SET_SITESRCH_ENH_FTR_URL_SITE are properties. 
We can find about more in these links


We don't know what happened, but something went wrong. Could you please try that again?

I recently ran into an issue I hadn't seen before when configuring Excel Services on SharePoint
2013 RTM. I'd performed all the configuration steps described on TechNet.
 However, when I tried to browse to a workbook, I got the following error:


I checked the event logs and the trace logs, and the root of the problem was an 
Excel Services Application error with event ID 5226: Unable to create or access workbook cache.


This might seem like a straightforward permission issue. However, what also tends to happen in this
situation is that the IIS application pool will stop, and this error gets buried under many more generic errors.
(I've seen event IDs 5231, 5239 and 5240, for which the official advice is to restart the server.
Obviously in this case that isn't much help.)

The fix is straightforward - change the permissions on the %WINDIR%\Temp folder. 
As a managed account, the Excel Services application pool is a member of the 
local WSS_WPG security group, which has read and execute permissions on the 
Temp folder. Add the modify permission, recycle the application pool, 
and everything should work properly.

You could of course grant permissions on the Temp folder to the individual application pool account - in this case, I opted to grant permissions to the WSS_WPG group in case other managed accounts need to create temporary cache files.

Sunday 10 April 2016

Step by Step guide to Migrate from SharePoint 2010 to SharePoint 2013




Migration from an older version to a new one definitely poses as a need with features being added in newer versions. SharePoint 2013 is Microsoft’s new SharePoint version loaded with some great features. SharePoint 2010 version is very popular among organizations due its radical features and remarkable integration capabilities.
With the launch of SharePoint 2013, SharePoint’s market share and positioning has reached to a completely different level. However, SharePoint 2010 is still used across organizations and many of these organizations are looking forward to upgrade to the more powerful and immensely successful 2013 version.
If you also want to integrate SharePoint 2013 features into your network, then this guide is for you.
Before you start migration keep these things in mind:
  • Update SharePoint 2010 farm with latest service packs/patches installed on your SharePoint 2010 farm
  • Document farm configuration settings in SharePoint Server 2010
  • Change your SharePoint 2010 web applications from classic mode to claims
  • Cleanup environment by deleting unused site collection, removing unused features, and deleting orphaned users and sites. Also, cleanup old document versions and remove features which are not supported by SharePoint 2013
And, don’t forget to run database consistency check before taking database backup from SharePoint 2010 farm.
There is no direct upgrade possible from SharePoint 2010 to SharePoint 2013. So, the only way to upgrade is to migrate. You can’t reuse your existing Hardware for SharePoint 2013 and you can’t install both SharePoint 2010 and SharePoint 2013 on same machine.
Migration Steps:
1. Create New SharePoint 2013 Farm
The very first step in migration is to install and configure new SharePoint 2013 farm. Setup all farm configuration in source SharePoint 2010 farm and it should include all essential configurations such as AAM, Email settings, managed pats, etc. Then, install all the third party software, language packs, custom features and solutions of SharePoint 2010 farm into your SharePoint 2013 farm. Create web application similar to your existing SharePoint 2010 farm for SharePoint 2013 farm.
Since, we use the existing content database from SharePoint 2010, therefore, you can delete default content database linked with the new web application. If you fail to delete the root site database of the existing web application, running a Test-SPContentDatabase cmdlet as a part of migration process can result in orphaned site issues. This happens because the root site collection exists in both the content databases which results in conflict.
2. Backup and Restore SharePoint 2010 Database to SharePoint 2013 SQL Server
The second step is to create a backup of SharePoint 2010 content databases and after that restore them into SharePoint 2013’s SQL Server.
This can be done by two ways, either by using central administration or by using PowerShell cmdlet.
  • By using central administration:
In order to retrieve all content databases of a particular web application you have to identify and make a list of all source content databases from central administration.
You can do it by following this path:
(Central Administration >> Application Management >> Manage Content Databases)
SP10tpSP13-1.png (1360×726)
  • By using PowerShell cmdlet:
Use the PowerShell cmdlet in order to retrieve all content databases of a particular web application.
Use the below syntax:
Get-SPContentDatabase -WebApplication “<Web App URL>” | Select Name
Create Backup
You can create a Backup of databases from SharePoint 2010 SQL Server by Log-in into the SQL server box of the SharePoint 2010 farm. And then, all you’ve to do is open SQL Server Management Studio and expand databases node.
Restore Database
To restore all databases from SharePoint 2010 to SharePoint 2013 SQL Server, copy all required databases backup files to your target SharePoint 2013’s SQL Server. Once you have copied the database files, the next step is to open SQL Server Management Studio and click restore database.
sql_restore.png (438×634)

3. Verify Content Databases with Test-SPContentDatabase
Simply execute PowerShell cmdlet: Test-SPContentDatabase cmdlet and scan content databases of provided web application in order to address any issue.
For this you can use syntax:
Test-SPContentDatabase -Name <Database name> -WebApplication <Web-App-URL>
This syntax will report various issues such as missing features, solution dependencies, orphaned sites, wide lists, etc.
4. Run “Mount-SPContentDatabase” to attach content databases to SharePoint 2013
Once you’ve fixed all the issues reported by Test-SPContentDatabase, you can start attaching content databases to SharePoint 2013 web application. Always try to mount the root site collection’s database first and if you’re migrating ‘My sites’ then migrate its host first.
Mount-SPContentDatabase -name “Database name” -DatabaseServer “Database Server Name” -WebApplication “Web-App-URL” -confirm: $false
After mounting the content database to web application you can easily access site collection in SharePoint 2010 mode.
5. Upgrade Site Collections to move to SharePoint 2013
The last step in migration process is upgrading the site collections. After migrating from SharePoint 2010 to SharePoint 2013 by default, all migrated site collections will be on SharePoint 2010 with its old look and feel and other functionalities. Therefore, you’ve to explicitly migrate all site collections to SharePoint 2013. This can be done by Site Collection administrators by clicking on the links available from upgrade reminder banner.
Get Upgrade Status:
Undoubtedly, upgrades are time consuming when there is a huge number of site collections present on the particular content database. You can easily get the status of upgrade from the “Upgrade Status” page in central administration page.
Follow this path:
(Central Admin >> Upgrade and Migration >> Check upgrade status)

Here is the SharePoint 2010 site migrated to SharePoint 2013:
The Final site after site collection upgrade:
Thus, you can successfully migrate SharePoint 2010 to SharePoint 2013.
Even after successful migration there are various limitations associated with native migration method, such as:
  1. It doesn’t support granular migration.
  2. It is very time consuming.
  3. Though, you can verify content before migration, but for that you should have knowledge various PowerShell commands.
  4. With it, you can’t migrate unlimited bulk content with utmost concurrency.
  5. Manual migration will increase chances of mistakes and data loss.
Due to these drawbacks, organizations that are looking to upgrade to SharePoint 2013 face various substantial planning challenges that limit both proof of concept and full implementations.
Fortunately, LepideMigrator for Documents – an automated solution to migrate content from SharePoint 2010 to SharePoint 2013 is designed to overcome the limitations of native migration method.
LepideMigrator for documents help you to avoid these risks by lessening the time and cost, while preserving the Meta data along with improving business intelligence.
Benefits offered by LepideMigrator for Documents are:
  • Its installation and user interface are quite user-friendly.
  • Not only content, but it also migrates Metadata automatically during migration.
  • Easy remapping of users between Source and SharePoint Servers.
  • It also migrates permissions from the Source to destination.
  • It allows to schedule the migration jobs to create an unbroken one-way synchronization between two lists, libraries, or sites of same/different SharePoint Server. The selected destination will be synchronized with the new/updated content and objects of the source.
  • Migrate large amount of content in bulk or perform granular migration to move only the content that’s needed.
Migration with LMD is as simple as:
  1. Add Source – Add SharePoint 2010
  2. Add Destination – Add SharePoint 2013
  3. Create Migration jobs to perform simple and timely migration. You can migrate site, list/library and items from source SharePoint to destination SharePoint.
  4. Schedule the content migration jobs from SharePoint 2010 to SharePoint 2013.
  5. You can also perform bulk migration of site, list/library and items using CSV files.
  6. With Migration history, view the stored records of all real-time migration jobs, scheduled migration jobs, and downloads from SharePoint.
Yes, migration can be that simple!
When you have such an easy and simple way to perform SharePoint migration, then why go for native migration methods. With LepideMigrator for Documents, organizations can have better control over the migration process and can solve a wide variety of common—yet complex—migration scenarios. And not just SharePoint to SharePoint migration, you can also migrate file servers and Exchange public folders to SharePoint as well.

Thursday 7 April 2016

SharePoint 2013: How To Integrate BCS with Search



New Titles Added Weekly!

Introduction

This post discusses the overall process of incorporating external data into SharePoint 2013 Search by leveraging Business Data Connectivity Services (BCS). I have an end-to-end solution that integrates product data from a SQL Server database into SharePoint 2013 by using external content types. This is covered in my Search Walkthrough Guide as well as my Enhancing the Search Experience Guide. However, the detailed steps are also available on their own within my SharePoint 2013 Solution Series guides. (Sorting and refinement only appear in the larger).


Step 1: Prepare the Data Source

The first step is to create your read list and read item procedures.
  • Create a stored procedure that returns all of the information you want to search and make sure all rows are returned. 
  • Create a stored procedure that returns the same information but only for a particular entity by using the ID as a parameter.

Step 2: Add Credentials to the Secure Store Service

In order for the External Content Type to be created and BCS to access your external data source, the data source credentials need to be stored. The Secure Store Service in SharePoint allows you to store credentials. For my scenario, a SQL database account was created named “AWDBAccount”. Therefore an entry in the Secure Store Service needs to be added for SQL Authentication.

Step 3: Create an External Content Type

The methods I describe in my books provides the steps for a no-code solution in creating an External Content Type that uses your data source as the provider of information via SharePoint Designer 2013.

Step 4: Set Permissions on the BCS Entity

I can imagine that this is often an overlooked step. Once the External Content Type is created, you need to give permissions to it, otherwise the search account as well as users will not be able to access the data.

Step 5: Create a Content Source for the External Content Type

In order to crawl the external data, you need to create a content source in Search.

Step 6: Create Managed Properties

After the crawl has completed, you now need to create managed properties and map them to the crawled properties from the new content source. This may be accomplished from the Search Service Application UI or from PowerShell. I describe both methods in my guide books.

Step 7: Create a Result Source

Step 8: Create a Result Type

Step 9: Create a Custom Search Results Page

Step 10: Add the Custom Search Results Page to the Search Navigation

Step 11: Test the Results


The results won't look too pretty. The remaining steps involve creating custom search display templates to properly present the external data search results.


Step 12: Create a Display Template

Step 13: Create an Item Hover Panel

Step 14: Update the Result Type to use the Display Template

Step 15: Test the Overall Results


Conclusion

In just 15 simple steps you can integrate external data into SharePoint 2013 Search by using external content types and BCS. You can get the entire end-to-end solution steps in my guides or from my SharePoint 2013 Solution Series:

SharePoint 2013: Database Schema Version Issue using Move-SPSite

You may use Move-SPSite in SharePoint PowerShell to move site collections from one content database to another. However after applying updates and creating new content databases, when attempting to move a site collection, you may receive the following error:


Cannot complete the copy or merge operation because the database schema versions are different.
 
 
Sometimes you content databases do not get properly upgraded during the installation of a cumulative update or service pack. There is a quick an easy fix. Just use the Upgrade-SPContentDatabase cmdlet to update the content database:
 
Upgrade-SPContentDatabase -Identity <<content database name>>
 
 


Just for good measure, I usually run this cmdlet on all content databases - just in case. The system will let you know if the content database does not need to upgraded.

Once all databases are in sync, you may use the Move-SPSite as normal without any database schema errors!

SharePoint 2013: Hiding the Blog Tools Web Part

Problem
You want users to have contribute rights to your blog site but do not wish to show the Blog Tools on the post pages. If you remove the web part, other blog web parts (e.g. Categories) do not work. If you modify the Blog Tools web part properties and select the Hidden property, the web part still renders.

Viewing the web part properties in the page (via SharePoint Designer) shows that the web part should not be visible and should be hidden:
BUT IT STILL DISPLAYS ON THE PAGE!

Solution
Modify the Blog Tools web part properties as follows:


  1. Change the Height to a fixed height of 0 pixels
  2. Change the Chrome State to Minimized
  3. Change the Chrome Type to None




Click OK and Save (or Stop Editing) the page.

Refresh and the Blog Tools web part is still on the page but does not show!

SharePoint 2013 Search: Error Launching Query Builder - RESOLVED

Problem
When attempting to launch the query builder when creating a new Content Source or Result Source via Central Admin you receive an error as follows:
Error: Not able to connect to search service to retrieve valid settings.


Solution
You need administrator rights to the Search Service Application - even if you are a farm administrator. (I just recently encountered this issue but thought it worked before - I am thinking that recent patches and updates plugged a security hole).

Solution Implementation - PowerShell
You can solve this easily by running the following PowerShell script with your account name:

$principal = New-SPClaimsPrincipal "DOMAIN\USERNAME" -IdentityType WindowsSamAccountName

$spapp = Get-SPEnterpriseSearchServiceApplication

$security = Get-SPServiceApplicationSecurity $spapp –Admin

Grant-SPObjectSecurity $security $principal "Full Control"

Set-SPServiceApplicationSecurity $spapp $security –Admin 

Solution Implementation - Central Admin
You may also solve this via Central Admin.

From Application Management, click on the Manage service applications link under the Service Applications section:


Scroll down to your Search Service Application and select it:


On the SERVICE APPLICATIONS top ribbon, click the Administrators button:


In the Administrators dialog, enter the account that needs permissions and click the Add button:

Select the account in the list and grant Full Control:


Click OK.

The Query Builder dialog will now launch properly without any trouble.