locked
CRM 2011 - Migrate Activities From/To CRM RRS feed

  • Question

  • Hi Forum,

    Need your view in regards to migrate activities from one CRM system to another (Both are on-premise CRM 2011).

    To explain it further, our company has overtaken another company who also use same version of CRM 2011. Now, we want to merge both the system to make single instance for employees from both the companies. Domain level migration is done and rest of the CRM records like Account, Contact, Lead etc.. is not a big problem. Some of the entities we are migrating using in-built export/import feature and some through using SDK to accommodate some business logic.

    My doubts are around activities records. What's the best way of migrating activities particularly Email and recurring appointments for which I have below 2 questions:

    1. How do I migrate email with notes and attachments. ( I think here I have to write custom code as native excel feature won't help. Any idea about doing this trough SDK? )

    2. How do I migrate recurring appointments. ( I know how to set up advance find to find these appointments but just by exporting and importing will do the job?  or I have to do it using SDK as well ? )

    3. Want to keep the status of the record as per the source system.

    Any suggestion will be greatly appreciated.

    Thanks for reading.

    Regards,

    H.Desai


    • Edited by H.Desai Monday, October 26, 2015 2:41 AM
    Monday, October 26, 2015 12:37 AM

Answers

  • You'll need to use the SDK, or migration tools such as SSIS (using extensions such that from Kingswaysoft or Cozyroc ). Some points to note:

    • It's a lot easier if you retain the primary key of each referenced record (e.g. account, contact) when you migrate them
    • For most activity types and states, you'll need a Create, followed by a SetState to change the status
    • You can retain the createdon value by setting overriddencreatedon, but you can't change the modifiedon
    • For recurring appointments, I think you'll have to migrate all historical instances

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by H.Desai Thursday, November 5, 2015 9:00 PM
    Monday, October 26, 2015 8:38 PM
    Moderator
  • you must first create the email and don't set the status and after the creation of the email  you set the statecode and statuscode frm the source organization 

    You can do something like that 

      newEmail = orgService.Create(mail); //Create the new email in the destination organization
                                    SetStateRequest reqState = new SetStateRequest();

                                    reqState.State = new OptionSetValue((int)EmailSource.StateCode);
                                    reqState.Status = new OptionSetValue((int)EmailSource.StatusCode.Value);
                                    reqState.EntityMoniker = new EntityReference(CrmOrgDestination.Email.EntityLogicalName, newEmail);


                                    var resp = (SetStateResponse)orgService.Execute(reqState);

    • Marked as answer by H.Desai Thursday, November 5, 2015 9:00 PM
    Wednesday, November 4, 2015 3:02 PM

All replies

  • You'll need to use the SDK, or migration tools such as SSIS (using extensions such that from Kingswaysoft or Cozyroc ). Some points to note:

    • It's a lot easier if you retain the primary key of each referenced record (e.g. account, contact) when you migrate them
    • For most activity types and states, you'll need a Create, followed by a SetState to change the status
    • You can retain the createdon value by setting overriddencreatedon, but you can't change the modifiedon
    • For recurring appointments, I think you'll have to migrate all historical instances

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by H.Desai Thursday, November 5, 2015 9:00 PM
    Monday, October 26, 2015 8:38 PM
    Moderator
  • Hi David,

    Thanks for taking time to answer my query.

    Regarding Email, do I have to create Draft copy first and then set the status to Sent/Received ? Will setting a status Sent will actually send the email ?

    I have already created a field in the destination system to hold primary key of the source system so that would be easy to reference in my SSIS script component.

    Thanks,

    H.Desai

    Tuesday, October 27, 2015 8:20 PM
  • Hi,

    I can have a look at the email creation later, but you could always do a couple of tests where you create emails to you own address and see what happens. I don't remember what happened last time I did this unfortunately :)

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, November 3, 2015 8:15 AM
  • Hi 

    you can do that with c# code 

    you must first migrate the contact\account\prospect and after migrate there activity like email , appointment and attachement 

    you can generate a crmHelpercode with SVCUTIL for the two organization and next create the code for migration 

    Wednesday, November 4, 2015 2:57 PM
  • you must first create the email and don't set the status and after the creation of the email  you set the statecode and statuscode frm the source organization 

    You can do something like that 

      newEmail = orgService.Create(mail); //Create the new email in the destination organization
                                    SetStateRequest reqState = new SetStateRequest();

                                    reqState.State = new OptionSetValue((int)EmailSource.StateCode);
                                    reqState.Status = new OptionSetValue((int)EmailSource.StatusCode.Value);
                                    reqState.EntityMoniker = new EntityReference(CrmOrgDestination.Email.EntityLogicalName, newEmail);


                                    var resp = (SetStateResponse)orgService.Execute(reqState);

    • Marked as answer by H.Desai Thursday, November 5, 2015 9:00 PM
    Wednesday, November 4, 2015 3:02 PM
  • Thank you all for your answers.

    I will follow your guidance to see what outcome I get.

    Thanks,

    H.Desai


    • Edited by H.Desai Thursday, November 5, 2015 9:01 PM
    Thursday, November 5, 2015 9:00 PM