I am trying to migrate a D6 site to D7. The source site is using content_profile and has a Location field as part of the profile type. I've been digging and found http://drupal.org/node/943178 and http://drupal.org/node/1938880 which suggest that the Location module has support for Migrate. I have the latest Location and it has location.migrate.inc. I have the following in my User migration class:

$this->addFieldMapping('field_profile_location')->defaultValue('TRUE');
$this->addFieldMapping('field_profile_location:city', 'field_profile_location:city');
$this->addFieldMapping('field_profile_location:province', 'field_profile_location:province');
$this->addFieldMapping('field_profile_location:country', 'field_profile_location:country');

This doesn't appear to be working though, the location field data is not being migrated. Any advice would be appreciated.

Comments

mikeryan’s picture

Status: Active » Closed (duplicate)

Let's not have two location issues - #1938880: Implementing migration of node location references.

I will say, though, that you should check the migration detail pages to see precisely what subfields are being exposed on the source and destination sides, I think you'll find some illumination there. For example, in D7 it would seem that the subfield for cities is 'locality'.

bkerwin’s picture

Could you just give me a quick pointer at the migration detail pages you're referring to? I did a good amount of searching before I made this issue and didn't see anything specific to a location field in a content profile type. Does it make any difference that the location field is in a content profile type, which I'm trying to migrate to a user location field in D7?

bkerwin’s picture

Status: Closed (duplicate) » Active

Reopening because this is not a dupe in my opinion.

Here is a more detailed explanation:

I am migrating from D6->D7. The D6 site uses Content Profile to extend users. The profile content type includes a Location (https://drupal.org/project/location) field with several subfields used (city, province, country).

On the D7 side I have added a location field to users with the same subfields enabled. I have the latest Location (7.x-3.0-rc2) installed which should have migration support (I see location.migrate.inc in the root of the location module). I need to get the source location fields into D7 as part of a User migration.

Below is my relevant code for the User migration class:

    $this->addFieldMapping('field_profile_location', 'field_profile_location');
    $this->addFieldMapping('field_profile_location:city', 'field_profile_location:city');
    $this->addFieldMapping('field_profile_location:province', 'field_profile_location:province');
    $this->addFieldMapping('field_profile_location:country', 'field_profile_location:country');

Looking at the detail page for my migration I see the following:

field_profile_location is listed in the source fields, but no subfields are listed. And field_profile_location is listed in the destination fields, but no subfields. Finally at the top of the detail page the following warnings are displayed:

"field_profile_location:city" was used as source field in the "field_profile_location:city" mapping but is not in list of source fields
"field_profile_location:city" was used as destination field in "field_profile_location:city" mapping but is not in list of destination fields
"field_profile_location:country" was used as source field in the "field_profile_location:country" mapping but is not in list of source fields
"field_profile_location:country" was used as destination field in "field_profile_location:country" mapping but is not in list of destination fields
"field_profile_location:province" was used as source field in the "field_profile_location:province" mapping but is not in list of source fields
"field_profile_location:province" was used as destination field in "field_profile_location:province" mapping but is not in list of destination fields

From everything I can find what I have should work and I do have other profile fields migrating fine, including a link field with subfield. Is there something special that needs to be done for a user migration if a location field is part of a content profile type? Or am I just missing something very basic? Any help would be greatly appreciated.

bkerwin’s picture

Issue summary: View changes

fixed block

mikeryan’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)
Related issues: +#1938880: Implementing migration of node location references

Whether the location field is in a content profile or in a regular node shouldn't make a difference - #2018113: Migrate Location module content from Drupal 6 applies here. Note that the solution there is documented at https://drupal.org/node/2018113, if you try that and have trouble with it, #2018113: Migrate Location module content from Drupal 6 would be the place to take it up.