5

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.

  • You didn't mention your host CMS - we use drupal & when scripting imports the migrate module handles the mappings – eileen Jul 26 '15 at 21:11
  • @EileenMcNaughton - I updated my question to clarify that our current CMS is a custom tool. – Dave Rolsky Jul 26 '15 at 21:19
  • eileen means which CMS is your CiviCRM using. Drupal Joomla or WordPress – petednz - fuzion Jul 26 '15 at 22:25
  • 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. – Jon G - Megaphone Tech Jul 26 '15 at 23:41
  • @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. – Dave Rolsky Jul 27 '15 at 1:34
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.

2

If you are on Drupal you can use the Eileen's 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.