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.

SharePoint 2013: Image Preview in Search Results - Part II

This is the second post on previewing images in SharePoint search results. The first post is here.

In the first post I demonstrated a way to display image previews in search results and resolved two problems. But what about the images in a Picture Libary? I didn't see them appear in search results as pictures until I added the file types. Shouldn't there be special results for Picture types?

UPDATE: Get the source files here


Previewing of Images Stored In Picture Libraries

Problem #1: Images in Picture Libraries Returned as Files or List Items
After going through the steps in Part I , even images stored in Picture Libraries are returned as files themselves. The hover works fine but you should be able to take advantage of the image result type.

Solution to Problem #1: Copy and Configure the Image Result Type

In your Search Center site collection select Site settings from the settings menu:

Under Site Collection Administration, click on Search Result Types:


Scroll down and find Image. Use the drop-down menu and select Copy:


On the Add Result Type page, select Picture Item udner What should these results look like?


Click Save:
Run a search for an item in a Picture Library:



 
There is a preview image right in the results! That's great but that didn't happen in image results from other types of libraries - onto Problem #2.
 
Problem #2: Image Search Results Not Consistent
Now the results from a Picture Library and non-Picture Library look different. It is not consistent for the user:

Solution to Problem #2: Modify the Display Template for the Result. 
This time you need to edit the Item_Picture.html file.

Simply add an else statement to the if in the middle of the code:

 else {
           ctx.CurrentItem.csr_PreviewImage = ctx.CurrentItem.Path;
      }


(If you only see .js files, the .js code to  modify is at the bottom of this post)

Save the file and run a search again:

 


Now all images that are returned have a preview image in the results!!!!

But now the hover is the Picture Library List item hover, not the one I modified in the first post. So in the next and last post of this series I modify that hover to include a larger preview!



If you are not running search in a Search Center Site Collection and/or you only see .js files in your Search Display Templates, here is the resultant .js code to paste over after the render header in Item_Picture.js:

    if(!Srch.U.n(ctx.CurrentItem.PictureThumbnailURL) && !ctx.CurrentItem.IsContainer) {
     ctx.CurrentItem.csr_PathLength = Srch.U.pathTruncationLengthWithPreview;
                    ctx.CurrentItem.csr_PreviewImage = ctx.CurrentItem.PictureThumbnailURL;
       }
      else {
           ctx.CurrentItem.csr_PreviewImage = ctx.CurrentItem.Path;
      }


Wednesday, 6 April 2016

SharePoint 2013: Image Preview in Search Results - Part I

I was discussing SharePoint Search previews of images on Twitter with Jasper Oosterveld . 
The discussion made me look into image previews in search results. As a result, I looked at various options and functionality to this regard. I am splitting these posts into at least two parts so I can get part of my solution out as soon as possible. This post solves the previewing of images that are not in Picture Libraries.

UPDATE: Get the source files here

Previewing of Images Not Stored in Picture Libraries

Problem #1: Image Search Results Are List Items

When images are stored in "regular" document libraries such as Site Assets, they are uploaded as documents. When the library is crawled, the results are the actual list item and not the image itself. Even if you add the Image or Picture content type to the library and modify the item, the result is still treated like a list item.

Solution to Problem #1:  Add Image File Types to Search
The reason the images are coming back as items is because image file types such as .jpg and .gif are not in the list of the search file types.

So you need to go to Central Administration and modify the Search Service Application. On the left hand side click on File Types:


On the File Types page, click on New File Type:



Enter an image file type such as jpg and click ok:



Repeat the process for other image types you want to handle.

Now go to the document library that contains the images and select Library settings from the Library top ribbon:


On the Settings page, click on Advanced Settings:


Scroll down and find the Reindex Document Library button and click it:

 
In the dialog that appears, click Reindex Document Library:

Click OK on the Advanced Settings page.
 
Now return to your Search Service Application and run an incremental crawl on the main content source:
 
 
After the crawl is completed, the search results of the images should appear as their filename instead of a list item. That solves that problem but the hover is still the Default hover template and doesn't show an image preview.
 

Problem #2: Image Search Results Hover Doesn't Show Preview
Now that the search is crawling image types, the results display the image file but the hover is using the default item template and no image appears.
  
 
UPDATE: You do not need to go through the modification of the default hover although I did in the beginning before I figured out all that was happening. The overall cause of this issue is that Image result type uses the Default Item template and not the Picture template. My solutions in Part II and Part III explain how do implement this better.

 
Solution to Problem #2: Modify the Default Hover Panel Display Template
The solution here is to modify the hover display template that is being used for default items. This can be easily performed using SharePoint Designer 2013. Follow the steps to get to the Display Templates as I have outlined previously.
 
This time, edit the Item_Default_HoverPanel.html file. Replace the RenderBody section with the following code:

                <!--#_
                    if(ctx.CurrentItem.FileExtension == "jpg" || ctx.CurrentItem.FileExtension == "gif"){
_#-->
                        <div class="ms-srch-hover-imageContainer">
                            <img id="_#= ctx.CurrentItem.csr_id =#_" src="_#= $urlHtmlEncode(ctx.CurrentItem.Path) =#_" onload="this.style.display='block';" />
                        </div>
<!--#_
                }
                else {
_#-->
    <div id="_#= $htmlEncode(id + HP.ids.body) =#_" class="ms-srch-hover-body">
                    _#= ctx.RenderBody(ctx) =#_
                </div>
<!--#_
                }
_#-->
         
 
 

You may add more conditions for each file type you want to handle. You could also check the content type however, by default, the images loaded to Site Assets are documents. So if you want to capture all images I would use the file extension check.

Save those changes and then perform a search. Hover over the image results:


Voila!!! The hover shows a preview of the image!!!

But that's not all folks. If you have Picture Libraries you could have even better results and previews but then that change will negate the solution provided here. I discuss this functionality and customization in my Part II post.