Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Data migration from one entity to another entity

Posted on by Microsoft Employee

Is it possible to take the data from the contacts entity and migrate to the Leads entity and maintain the relationships in Dynamics CRM?

Thanks,

Naveen

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Data migration from one entity to another entity

    Hi NKumar

    if you solved the problem thanks to an answer, please mark it as verified to encourage the community to provide more and more a better support. Thank you. Francesco

    If you found the answer helpful, please mark as Verified 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Data migration from one entity to another entity

    Hi,

     it depends on what kind of relationships you need to maintain - if those are not just lookup fields (for which you can probably simply copy data from contacts to leads), you'll need to migrate those 1:N and N:N relationships, too (which is doable, but it would be a separate "step in the migration process)

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Data migration from one entity to another entity

    You should be able to easily do it using an SSIS package and KingswaySoft.

    I would basically read all the Contact records, manipulate the data as needed, and Create the Lead records. As mentioned, have the Contact information (id) stored in the Lead record so that you can link between them.

    Since you are using CRM On-Prem, you can also use an OLEDB Source and access the FilteredView directly when READING the Contact information, in case you need to access other related records or entities (although, this case also be done with fetchXml and a CRM Source Component).

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Data migration from one entity to another entity

    I writed the following code for you.

    Hope it helps.

    Dictionary<string, string> attributeNameDict = new Dictionary<string, string>();
    
    attributeNameDict["emailaddress1"] = "emailaddress1"; // system attribute
    attributeNameDict["fullname"] = "new_fullname"; // custom attribute
    // etc ... List<Entity> contactList = null; // ... retrieve list; foreach (Entity contact in contactList) { Entity newlead = new Entity("lead"); foreach (KeyValuePair<string, string> kvp in attributeNameDict) { newlead[kvp.Value] = contact[kvp.Key]; } newlead["new_contactid"] = contact.ToEntityReference(); svc.Create(newlead); }

    If you found the answer helpful, please mark as Verified 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna, ITALY

    Independent Contractor

    http://www.francescopicchi.com

    dynamicscrmcoe.com/easy-crm-language-translations

  • Chadi Tannous Profile Picture
    Chadi Tannous 1,037 on at
    RE: Data migration from one entity to another entity

    you can export the data as excel and import them into the lead Entity after moving the data from the exported excel to the Excel Template of the lead

    and you can set the link of the contact in the lead Entity in the field existing contact.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans