locked
Using Data Migration Manager to inport Contacts and link them to existing Accounts. RRS feed

  • Question

  • I am using CRM 4.0 Microsoft Dynamics CRM Data Migration Manager.

    I have successfully used the Migration Manager to load The Accounts entity.  I used SQL to generate guids for my Account records and the import went fine.  The resulting accounts contain the accountId's I expected that I generated.  But when I went to import the Contacts, I created a file containing the accountId to link the contact to, but using the wizard, there was no way to link the Contact to the Account.  After doing some digging in the Contact entitiy, I discovered that there was an N:1 relationship from Contact to Account, but that relationship had no attribute name!  There was no way to give it a name either.  So I had the Migration tool make an Export Map, then modified the Map manually to include a LookupMaps node to map the accountId field I am inporting to the existing accountId in the Account entity.  When I imported the Map file, all went well.  When I imported the data, all seemed to go well in that I got no errors and all my contacts were imported, however they were not associated to their Accounts.  When I then went directly to the Database, the accountId field in the ContactBase Table was empty. 

    Does anyone know a trick to successfully import Contacts and have thier relationship to their Owning Accounts maintained?  All of our Contacts are owned by Accounts and it is very important that I maintain referential integrity.

    below is a snipet of the map code I have included in my ContactsMap

     

    <AttributeMap>

    <SourceAttributeName>AccountID</SourceAttributeName>

    <TargetAttributeName>accountid</TargetAttributeName>

    <ProcessCode>Process</ProcessCode>

    <LookupMaps>

    <LookupMap>

    <LookupType>System</LookupType>

    <LookupEntityName>account</LookupEntityName>

    <LookupAttributeName>accountid</LookupAttributeName>

    <ProcessCode>Process</ProcessCode>

    </LookupMap>

    </LookupMaps>

    </AttributeMap>

    Monday, March 17, 2008 5:55 PM

Answers

  • The following modification solved my problem:

     

    <AttributeMap>

    <SourceAttributeName>AccountId</SourceAttributeName>

    <TargetAttributeName>parentcustomerid</TargetAttributeName>

    <ProcessCode>Process</ProcessCode>

    <LookupMaps>

    <LookupMap>

    <LookupType>System</LookupType>

    <LookupEntityName>account</LookupEntityName>

    <LookupAttributeName>accountid</LookupAttributeName>

    <ProcessCode>Process</ProcessCode>

    </LookupMap>

    </LookupMaps>

    </AttributeMap>

     

    Apparently the TargetAttributeName must be parentcustomerid

    Monday, March 17, 2008 9:10 PM

All replies

  • Dave,

                You may be able to use the ‘sampledatamap.xml’ file from the Microsoft ‘Sample Data’ download as your mapping or at least as a reference point.  Another option is using a tool such as Scribe to handle the data load.  I don’t have any first hand experience with Scribe, but the people I’ve talked with say it's handy.

     

    Sample Data - http://download.microsoft.com/download/e/4/9/e49567e6-3479-44f3-a02a-99eb779db221/Microsoft_Dynamics_CRM_4.0_Sample_Data_Readme_version_4.0.2.htm

     

    Scribe - http://www.scribesoftware.com/

     

    Hope that helps,

    Jason

     

    Monday, March 17, 2008 8:39 PM
  • The following modification solved my problem:

     

    <AttributeMap>

    <SourceAttributeName>AccountId</SourceAttributeName>

    <TargetAttributeName>parentcustomerid</TargetAttributeName>

    <ProcessCode>Process</ProcessCode>

    <LookupMaps>

    <LookupMap>

    <LookupType>System</LookupType>

    <LookupEntityName>account</LookupEntityName>

    <LookupAttributeName>accountid</LookupAttributeName>

    <ProcessCode>Process</ProcessCode>

    </LookupMap>

    </LookupMaps>

    </AttributeMap>

     

    Apparently the TargetAttributeName must be parentcustomerid

    Monday, March 17, 2008 9:10 PM