Migrate Dynamics 365 Notes Attachments to SharePoint

Quite often we run across a Dynamics 365 implementation where not much thought was giving to Document Management while implementation, resulting in user using Notes(Annotation) entity for document management.

Notes do offer a lightweight solution for managing and uploading documents to related record but it lacks the capabilities of a full-fledged document management capabilities. Notes are also stored in CRM database, storing documents as notes could easily become a costly endeavor considering Dynamics 365 storage cost. Jukka Niiranen has written a great blog on file storage and disadvantages of using Notes/Annotation.

The first step to transition from using CRM Notes to SharePoint for document management is migrating existing documents from Notes to SharePoint. This may seem like a daunting task but could easily be accomplished using SSIS package for migration.

I have an SSIS starter project on GitHub which illustrates the migration for notes related to Case entity, It could be easily configured to migrate notes related to any other entity.

SSIS by itself doesn’t provide capabilities to connect with Dynamics 365, for this, we use a third-party connector like KingswaySoft or CozyRoc, in below example we are using KingswaySoft connector, license and pricing details could be found here. Kingsway does provide the developer license free of cost.

In this post, we will go over steps required to migrate Notes to SharePoint and how to use Annotation2Sharepoint Project.

PreCheck/ Analysis

  • The first step in the process is to identify entities which have associated notes/ document requiring migration as you will need a separate package for each entity.
  • Once identified check how document management is being configured, things to check:
    1. Document management is configured by Entity or by Account or Contact Entity.
    2. Check if Configuration is using GUID in folder path or not, I highly recommend not using GUID in the folder name (steps to change the config)  for SharePoint document categorization, instead use just title or name(primary field) this does mean that you need an autonumbering solution to keep name or primary filed unique. It could also be useful to enforce this by creating an alternate key on primary field. In order to change the setting use OrgDBOrgSettings tool for Microsoft Dynamics CRM.

Build

  • You can start by downloading my  Annotation2Sharepoint project from Github, The project package is created using VS 2017 SSDT, The project also uses KingswaySoft connector’s, You can download them from below link:
  • The package moves the document from notes regarding Case entity to Sharepoint, it is built for default OOB SharePoint integration setup. so you will need to modify the package if using a different folder structure.
  • Update the connection manager to point to your Dynamics 365 CE instance and Microsoft SharePoint.
  • The package uses project parameter “FolderwithGuid”, set it to false if CreateSPFoldersUsingNameandGuid in OrgDBOrgSettings is set to false, the default value is true.

 

  • The data flow tasks have two Dynamics 365 data sources using fetchxml.
    • The 1st data source is for retrieving the associated Entity record, modify this to query the Entity. Starter package uses case entity
    • A 2nd Data source is to retrieve the notes entity containing documents.
  • Modify the fetch XML if migrating data related to another entity.
  • The input from the 1st data source is used to create Document location record in Dynamics 365, modify the”Derive Document Location details” component and set below highlighted columns to entity schema name.

 

The Annotation2Sharepoint package can be used for different migration scenarios, such as:

  • Migrating documents from Dynamics 365 CE On-Premise Notes To SharePoint.
  • Migrating documents from Dynamics 365 CE online Notes To SharePoint.
  • Migrating from Fileserver to Sharepoint for a new Dynamics 365 CE installation.

Please give the package a try and let me know if you have any comments.  Let me know how migration went for you or any other integration scenarios that you ended up using this package.

I hope that you find the package useful.

4 thoughts on “Migrate Dynamics 365 Notes Attachments to SharePoint”

  1. Hi Kunal,
    I am performing this SSIS package for Quote but I got an error.
    here is the error:

    TITLE: Package Validation Error
    ——————————

    Package Validation Error

    ——————————
    ADDITIONAL INFORMATION:

    Error at Migrate Documents from Dynamics 365 Notes to SharePoint [Premium Derived Column [415]]: The component is missing, not registered, not upgradeable, or missing required interfaces. The contact information for this component is “KingswaySoft Inc.; http://www.kingswaysoft.com; support@kingswaysoft.com; Copyright 2011-2017 KingswaySoft Inc.”.

    Error at Migrate Documents from Dynamics 365 Notes to SharePoint [SSIS.Pipeline]: Premium Derived Column failed validation and returned error code 0xC0048021.

    Error at Migrate Documents from Dynamics 365 Notes to SharePoint [SSIS.Pipeline]: One or more component failed validation.

    Error at Migrate Documents from Dynamics 365 Notes to SharePoint: There were errors during task validation.

    (Microsoft.DataTransformationServices.VsIntegration)

    ——————————
    BUTTONS:

    OK
    ——————————

    can you please help for the same.

    Thanks

      1. Hi Kunal,

        Thanks for the Reply!!
        I have resolve that connector issue for Microsoft SharePoint. Thanks a lot for that.
        but now I am facing another issue.
        when I pass the document body in Premium Derived Column

        DecodeBase64( [ag.documentbody] )

        I got “An error occurred while testing the expression: Invalid Expression: Invalid length for a Base-64 char array or string.”
        If I upload more 2 MB files to SharePoint but it crashed, all the files converted in 1.46kb.

        for more reference please check my question with the screenshot: https://community.dynamics.com/crm/f/117/t/310441

        Thanks in advance.
        Pankil

        1. HI Pankil, The Test feature on Expression editor will not work as you don’t have any input currently and documentbody is null. The Validate button next to text can validate if the expression is right. run the package for a small set of data to do actual validation.

Leave a Reply

Your email address will not be published. Required fields are marked *