Drupal 7 Migrate V2 and Addressfield: SOLVED!
I had to migrate site members from a legacy site with an Oracle db to a relaunch on Drupal 7. Instead of connecting directly to Oracle, I was provided with an Excel dump which I converted to csv. Also the old site does not require members to be authenticated, so I did not have to deal with old passwords.
There are a lot of stale posts in Google results about migrating Addressfield that do not work on the latest Migrate V2 for Drupal 7. For one thing arguments in the field mapping are deprecated.
Using the Migrate module I was able to create migration classes for the users, and some other information; but I got stuck at importing the address data into the Drupal Addressfield table, because it uses subfields and requires building an array in Migrate.
I used colon notation for subfield mapping, but it was not working.
<?php $this->addFieldMapping('body', 'body'); $this->addFieldMapping('body:summary', 'excerpt');?>
Migrate kept throwing an error: Call to a member function import() on a non-object
But when I put drush_print_r on the line throwing the error, I could see the stdClass object arrays were there and populated with the correct data.
I decided to abandon the Addressfield migrate class and use db_insert in an existing class (class SchoolMigration) where I was already running db queries.
It worked, and although I was worried a direct db_insert would not roll back, since I registered the inserts in the process() function for class SchoolMigration, they also rolled back.