Migrating from Ektron to Sitecore: Suggested Field Mappings

So you wanna migrate from Ektron to Sitecore …

Overview

Your client has chosen to migrate from Ektron to Sitecore. How can the data be migrated?

In this series, I’ll describe the process that our team recently went through for migrating Ektron content to Sitecore without a content migration tool, without the Ektron API, but by diving right into the database.

Be sure to read the first 3 posts of this series before reading this one.  The links are at the bottom of this post.

About Our Project

We worked with Ektron Version: 9.10 SP1 (Build 9.1.0.184).

Content Table

Let’s do a deeper dive into the columns that make up the dbo.content table of Ektron.

Below is a mapping of Ektron fields to potential Sitecore template fields that our project used and a short explanation if needed.

Ektron column Sitecore field Note
content_id “Legacy Content Id” Include on a new _Imported interface template which is referenced on each Sitecore page template
content_language  __language You’ll need to do additional data massaging.  For instance, 1033 = “en”
content_title Item Name
(and possibly Display Name)
 For the item name, make sure to massage out all the characters that your Sitecore settings don’t support.
NOTE: If there is an alias set up for this content_Id (see UrlAliasMapping table in Ektron), use that value for the Item Name).
content_html
(XML field)
*All template-specific fields
(and possibly Display Name)
This field is the xml of the template-specific fields.
date_created __Created Ektron date format:
2016-09-21 03:09:08.000
Sitecore format:
20160921T030908Z
See conversion tip below.
last_edit_lname __ Updated by
__Owner
Concatenate the first and last name to form match a Sitecore userid.
last_edit_fname __ Updated by
__Owner
Concatenate the first and last name to form match a Sitecore userid.
last_edit_date __ Updated Ektron date format:
2016-09-21 03:09:08.000
Sitecore format:
20160921T030908Z
See conversion tip below.
content_teaser Meta Description
and possibly Teaser
This field may or may not be populated by the content author.
go_live_date Published Date Include as an interface template field if desired.
end_date Archive Date As mentioned in a previous post, if this field is populated, upon save, Sitecore moves this item to the Archive table (out of the master table).
image Meta Image This field may or may not be populated by the content author.

Conversion tip for Dates

The Ektron columns with datatype of DateTime will store the datetime in this format:
2016-09-21 03:09:08.000
Sitecore expects the dates to be in this format: 20160921T030908Z.

Assuming you are using Entity Framework to extract the data, the date fields will be available in a DateTime format.  Use the following to convert it to a Sitecore datetime string.

internal string ConvertDateToString(DateTime date)
 {
 var sitecoreDateTime = 
Sitecore.Common.DateTimeExtensions.SpecifyKind(date, DateTimeKind.Utc);
 return Sitecore.DateUtil.ToIsoDate(sitecoreDateTime);
 }

IMPORTANT: Dates stored in the content_html column are typically stored in a string format.  You’ll have to convert them to a datetime format and then use the method above to convert them to a Sitecore datetime string.

Conversion tip for Statistics

Within the Sitecore.Data.Items.ItemEditing API class, you’ll either use EditContext or .Editing.BeginEdit() method.   if you use the statements above without additional parameters, the Updated and Updated By fields will be auto-populated by Sitecore, even if you set them while modifying the item.

You can turn off this functionality by setting the ‘updateStatistics’ optional parameter to false.


Check out all posts for this series:

Advertisements