Surendra Sharma

Surendra Sharma

Search This Blog

Sunday, August 28, 2016

Content migration guide for Sitecore

Content migration is itself a project within a project and luckily I was extensively involved on different projects where content migration is one of the most important story of the project.

In one of the Sitecore project, I developed lots of scripts to migrate over 500,000 records from different sources to Sitecore.

During these migration, I come across with different situations and found some most suitable way to deal with.

I tried to cover all such technics in this guide. Below are the key topics that I want to emphasized
  • Introduction
  • Questions for client
  • Data Mapping
  • Data Representation and Mapping
  • Source of Data
  • Data Migration Map
  • Why SQL Server
  • Guidelines for content migration resources and team
  • Images and Media
  • Sitecore Fields
  • Migration Code
  • Log Files
  • Code Technique
  • Testing

I tried my best to include all the scenarios that are associated with content migration.

You can read and download this white paper from here:

Please leave your comments or share this guide if it’s useful for you.

Friday, August 26, 2016

How to get media library extension and mime type programmatically in Sitecore

One of my colleague asked me that how to get extension of uploaded file in Sitecore media library programmatically?

Here are different pointers which may be useful for you while working with media library 

·         You can get media library item in LinkField type from Sitecore.Data.Fields namespace.

·         LinkField.TargetItem -> gives reference of media library item.

·         Sitecore.Resources.Media.MediaManager.GetMediaUrl(linkField.TargetItem) -> Return media links

·         By default, link extension is “.ashx

·         Get the extension and mime type of media library item by using below code

//Return extension like gif
string mediaItemExtension = linkField.TargetItem.Fields["Extension"].Value;

//Return mime type like image/gif
string mediaItemMimeType = linkField.TargetItem.Fields["Mime Type"].Value;

·         You can also view both of these fields in Sitecore content tree as

Media Item
Media item
·         Let me cover one important entry in web.config file for media library item extension.
      Indicating whether to include a file extension when generating an item name from a file name.
      Default value: "false"
<setting name="Media.IncludeExtensionsInItemNames" value="false"/>

·         As comments above explain that if you want to include extension in media item name then set this property as true and when you upload any file in media library for example “1.JPG” then after uploading, Sitecore give its name as “1 jpg” as shown in below image. By default this value is false and for uploading “1.JPG”, Sitecore name it as “1” as shown in first image.

Media Item with extension
Media item with extension

Please leave your comments or share these tip if it’s useful for you.

Monday, August 15, 2016

In just 1 hour - Implement Organization’s Password Policies in Sitecore

Today is very special day for me for three reasons

1.    I am celebrating 70th Independence Day of India.
2.    This is my 250th blog post
3.    I got new domain name for my blog as
On this special occasion, I am going to publish my second eBook which is available FREE to download. 

This eBook is about implementing password policy in Sitecore. 

In almost all the web application developers need to implement password policies. This guide covers all possible policies and their implementation technics with code in Sitecore. This guide covers implementation of below policies

              Minimum Password Length
              Consecutive Unsuccessful Login Attempts
              Password Complexity
              Forgot Password
              Password Expiration
              Change Password

After going through this guide, one should able to implement all these policies in less than 1 hour.
I tried my best to include all the scenarios that are associated with password policies management.

You can read and freely download this developer’s guide:

Please leave your comments or share this guide if it’s useful for you.