Answers.Body: <p>If it's a new civi installation (with no contacts) it's not bad because all of the external identifiers are available.</p>
  
  <p>I don't know of a way to do them in one fell swoop.</p>
  
  <p>We typically import contacts using their old id as the external identifier and then import the activities.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-26T21:25:23.363Z
Answers.LastActivityDate: 2015-07-26T21:25:23.363Z
Answers.UserDisplayName: pmoz
Answers.Body: <p>If you are on Drupal you can use the Eileen's <a href="https://github.com/eileenmcnaughton/civimigrate" rel="nofollow">CiviMigrate</a> module to pull in the Contacts and the Activities. It still is effectively two runs of the import, since the Contacts 'have' to be created first, but the Migrate method lets you easily tweak, rerun, destroy, tweak, rerun etc</p>
  
  <p>You can read a blog about the process <a href="http://www.fuzion.co.nz/content/migrate-2-civicrm-api-3-civimigrate" rel="nofollow">here</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-27T04:36:41.443Z
Answers.LastActivityDate: 2015-07-27T04:36:41.443Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>I'm working on some scripts to export data from our current CMS (a custom in-house tool) to CiviCRM. This is a first import, and CiviCRM is a blank slate.</p>
  
  <p>When importing activities it seems like the "Source Contact" column must be a civicrm ID.</p>
  
  <p>I think this means I have to first import all the contacts, then pull a mapping from their CiviCRM ID to their external ID, and then import activities with the source contact column updated to match the CiviCRM ID.</p>
  
  <p>Of course, this is entirely feasible, but if there's a simpler way to do this I'd love to know about it.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-26T21:11:12.633Z
Comments.Text: You didn't mention your host CMS - we use drupal & when scripting imports the migrate module handles the mappings
Comments.UserDisplayName: eileen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-26T21:19:44.347Z
Comments.Text: @EileenMcNaughton - I updated my question to clarify that our current CMS is a custom tool.
Comments.UserDisplayName: Dave Rolsky
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-26T22:25:51.720Z
Comments.Text: eileen means which CMS is your CiviCRM using. Drupal Joomla or WordPress
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-26T23:41:19.960Z
Comments.Text: You didn't mention what language/tools you're using for scripting - but there's no way to import activities simultaneously with contact records.  That said, there are lots of ways to do them all in one script, so you push a button, walk away, and contacts/activities are all imported.  But these techniques all internally rely on importing contacts, mapping the external ID to contact ID, and importing activities.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-27T01:34:05.007Z
Comments.Text: @JonG - yes, my main question was whether there was any way to do it all together. I can easily script the whole process myself if I feel like it's worth the effort. Given that the old CRM and the new CRM are on two different servers, I'll probably just break it into a few steps that I do manually.
Comments.UserDisplayName: Dave Rolsky
Tags: <import>
Title: How can I most easily import Activities and Contacts together?
ThreadText: # How can I most easily import Activities and Contacts together?
  
  (Asked by: username_0 on 2015-07-26)
  
  I'm working on some scripts to export data from our current CMS (a custom in-house tool) to CiviCRM. This is a first import, and CiviCRM is a blank slate.
  
  When importing activities it seems like the "Source Contact" column must be a civicrm ID.
  
  I think this means I have to first import all the contacts, then pull a mapping from their CiviCRM ID to their external ID, and then import activities with the source contact column updated to match the CiviCRM ID.
  
  Of course, this is entirely feasible, but if there's a simpler way to do this I'd love to know about it.
  
  **Tags:** import
  
  > **Comments:**
  > **username_1**: You didn't mention your host CMS - we use drupal & when scripting imports the migrate module handles the mappings  
  > **username_0**: @EileenMcNaughton - I updated my question to clarify that our current CMS is a custom tool.  
  > **username_2**: username_1 means which CMS is your CiviCRM using. Drupal Joomla or WordPress  
  > **username_3**: You didn't mention what language/tools you're using for scripting - but there's no way to import activities simultaneously with contact records.  That said, there are lots of ways to do them all in one script, so you push a button, walk away, and contacts/activities are all imported.  But these techniques all internally rely on importing contacts, mapping the external ID to contact ID, and importing activities.  
  > **username_0**: @JonG - yes, my main question was whether there was any way to do it all together. I can easily script the whole process myself if I feel like it's worth the effort. Given that the old CRM and the new CRM are on two different servers, I'll probably just break it into a few steps that I do manually.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_4 on 2015-07-26. Score: 3
  
  If it's a new civi installation (with no contacts) it's not bad because all of the external identifiers are available.
  
  I don't know of a way to do them in one fell swoop.
  
  We typically import contacts using their old id as the external identifier and then import the activities.
  
  
  ---
  
  ### Answer by username_2 on 2015-07-27. Score: 2
  
  If you are on Drupal you can use the username_1's [CiviMigrate](https://github.com/eileenmcnaughton/civimigrate) module to pull in the Contacts and the Activities. It still is effectively two runs of the import, since the Contacts 'have' to be created first, but the Migrate method lets you easily tweak, rerun, destroy, tweak, rerun etc
  
  You can read a blog about the process [here](http://www.username_2.co.nz/content/migrate-2-civicrm-api-3-civimigrate)
  
  
  ---
  
  