Migrating old CRM KB Article data to the new Knowledge Article

21 June 2016
Chen Huang

Microsoft Dynamics CRM 2016 (both Online and on-premises) has introduced a new knowledge management system that offers many new features compared to the knowledge management capabilities offered in previous versions. Powered by the also newly introduced interactive service hub, the new knowledge management system allows the creation of much richer knowledge articles with support for embedding external multimedia contents, such as images and videos, as links. Additionally, the new knowledge management feature provides support for article versioning and translation, which makes it a truly enterprise ready feature.

As Microsoft rolls out these new features, it becomes a natural decision for Microsoft to announced the deprecation of old knowledge management entities, which include KbArticle, KbArticleComment, and KbArticleTemplate. Further details about the deprecation can be found in one of Microsoft recent announcements.

If it happens to be the case that you have used the old knowledge articles in past or current CRM projects, you likely need to migrate data from the old knowledge management feature to the new one.

In this blog post, we will demonstrate how to use our software to migrate old KbArticle data to the new knowledgebase without having to write a single line of code. When discussing the migration project, would like to also discuss the techniques that can be used to work with article versioning.

Some background information about the new Knowledge Articles

The access to the new knowledgebase functionality is available in a yellow bar above the Articles grid:

CRM KnowledgeArticle Access

By clicking the “Access it here” link, you will be directed to the new knowledge articles page:

CRM KnowledgeArticle Page

Each article has a major version number, a minor version number and it also comes with a language attribute. When you create a new knowledge article record, the major version is automatically set to 1 and minor version to 0. If no other language is specified, the article would be generated in the default language of the CRM installation.

When you create a knowledge article record through the UI, the Article Publish Number is automatically generated based on the format specified in the CRM settings, it stores the unique ID as reference to look up knowledge articles and remains the same across versions and translations.

The new knowledge management solution provides a rich text editor in HTML format as compared to associating with an Article template to define the formatting and sections in the old Article entities.

How To Migrate To CRM KnowledgeArticle Entity

The core of the new knowledge management solution is the KnowledgeArticle entity which stores and manages knowledge locally in CRM. Every knowledge article record has a root article record internally created by CRM, the root article acts like a container for all article versions and translations. The root record would be automatically deleted if all article versions and translations are deleted. It is easy to identify the root record since it has a “True” value in isrootarticle field and NULL values for all the contents and formatting fields.

Since all versions and translations and the root record have the same Article Publish Number, we would face two challenges if we try to migrate the KbArticle data to KnowledgeArticle entity:

  • How do we manage the versioning if any KnowledgeArticle records are updated with new versions during the migration process (let's say your migration spans a few weeks while you have the old CRM system and new CRM system running in parallel)?
  • How do we manage and work around with the root record, as it cannot be updated or deleted by external methods (CRM has a mechanism to delete it internally)?

You may find it difficult to overcome these obstacles, but there is always a solution when using our software. You can create the new knowledge records and update the latest version of the existing article records with our CRM integration toolkit.

It is quite easy to identify the latest version of existing article records and non-existing records by using a Left Join to the target knowledgebase and join on the Article Public Number, you will also need to include two fields from the target KnowledgeArticle entity: islatestversion and knowledgearticleid.

The islatestversion field can be used as an identifier to find the latest version of existing records and new records:

  • Islatestversion=NULL: non-existing records;
  • Islatestversion=True: latest version of existing records.

The left join can be performed by using FetchXML queries if your migration is within one CRM system, otherwise you need to use the SSIS Merge Join component to achieve this goal.

Let’s start from the FetchXML query option, you would be using a FetchXML query such as the following to combine the data in KBArticle and KnowledgeArticle:

<fetch mapping='logical'>
    <entity name='kbarticle'>
      <all-attributes />
      <link-entity name="knowledgearticle" from="articlepublicnumber" to="number" alias="ka" link-type="outer">
      <attribute name="islatestversion" />
      <attribute name="knowledgearticleid" />
      </link-entity>           
    </entity>
</fetch>

If you are migrating articles from two different systems, you would need to use an SSIS Merge Join component to join the data that you read from the source system and the CRM destination system.

Further, the state of Knowledge Article has expanded by four more states than the old KBArticle as shown below:

State

KBArticle

Knowledge Article

0

Draft

Draft

1

Unapproved

Approved

2

Published

Scheduled

3

 

Published

4

 

Expired

5

 

Archived

6

 

Discarded

This issue can be easily taken care of by using our CRM OptionSet Mapping component to manage the mappings of the statecode values (click here for the detail use of this component):

SSIS OptionSet Mapping Component

Then we use an SSIS Conditional Split to divide the input data based on the value of islatestversion field to locate new records and the latest version of the existing records.

The last step is to direct the input data into the target CRM servers using two CRM destination components. You just need to supply necessary fields in the destination component to create the new records, and update the latest version of the existing records by using “Primary Key” (knowledgearticleid) as the matching criteria.Mapping

Please note that you need to make sure that you have turned on “Ignore Null-Valued Fields” option in the CRM destination component. Otherwise you may receive “An unexpected error occurred” error message because CRM does not like having NULL value sent to keywords and description fields.

The data flow of Articles migration within one system would be:

Migration Sample 1

The migration dataflow between two systems might be:

Migration Sample 2

Sample SSIS Package

A sample SSIS package that includes both FetchXML task and SSIS Merge Join task can be download here.

The sample package was prepared in a SQL Server 2008 R2 format, and it should automatically upgrade if you are using any newer version of SSIS.

Closing Note

Our data flow task looks pretty complicated, the main reason is, we tried to show you a robust way to migrate from a legacy knowledgebase system to the new CRM one while keeping the two systems running at the same time, in which case there is a chance that a new version has been created in the new CRM system. If it is a one-off migration, the data flow can be much simpler, since we don't need to worry about the versioning in the new CRM KnowledgeArticle entity, and it would be a straight entity field-to-field mapping.

The sample package we provide in this blog post can also be used as the reference for the case that you need to integrate a third-party knowledgebase system with the new CRM KnowledgeArticle entity on an ongoing basis.

Hope you find this blog post useful.

KbArticle, KbArticleComment, and KbArticleTemplate
KbArticle, KbArticleComment, and KbArticleTemplate

Archive

December 2024 1 November 2024 3 October 2024 1 September 2024 1 August 2024 2 July 2024 1 June 2024 1 May 2024 1 April 2024 2 March 2024 2 February 2024 2 January 2024 2 December 2023 1 November 2023 1 October 2023 2 August 2023 1 July 2023 2 June 2023 1 May 2023 2 April 2023 1 March 2023 1 February 2023 1 January 2023 2 December 2022 1 November 2022 2 October 2022 2 September 2022 2 August 2022 2 July 2022 3 June 2022 2 May 2022 2 April 2022 3 March 2022 2 February 2022 1 January 2022 2 December 2021 1 October 2021 1 September 2021 2 August 2021 2 July 2021 2 June 2021 1 May 2021 1 April 2021 2 March 2021 2 February 2021 2 January 2021 2 December 2020 2 November 2020 4 October 2020 1 September 2020 3 August 2020 2 July 2020 1 June 2020 2 May 2020 1 April 2020 1 March 2020 1 February 2020 1 January 2020 1 December 2019 1 November 2019 1 October 2019 1 May 2019 1 February 2019 1 December 2018 2 November 2018 1 October 2018 4 September 2018 1 August 2018 1 July 2018 1 June 2018 3 April 2018 3 March 2018 3 February 2018 3 January 2018 2 December 2017 1 April 2017 1 March 2017 7 December 2016 1 November 2016 2 October 2016 1 September 2016 4 August 2016 1 June 2016 1 May 2016 3 April 2016 1 August 2015 1 April 2015 10 August 2014 1 July 2014 1 June 2014 2 May 2014 2 February 2014 1 January 2014 2 October 2013 1 September 2013 2 August 2013 2 June 2013 5 May 2013 2 March 2013 1 February 2013 1 January 2013 1 December 2012 2 November 2012 2 September 2012 2 July 2012 1 May 2012 3 April 2012 2 March 2012 2 January 2012 1

Tags