migrate d7 geolocation to d10 geolocation

Created on 13 September 2024, 5 months ago
Updated 16 September 2024, 5 months ago

Problem/Motivation

There seem to be migrations for various location* modules but I am getting error on geolocation to geolocation. I added a comment here ✨ Migration from D7: Attempt to create a field storage field_geolocation with no type Closed: outdated
Must be missing something basic?

πŸ’¬ Support request
Status

Postponed: needs info

Version

3.13

Component

Geolocation Field / Backend

Created by

πŸ‡³πŸ‡ΏNew Zealand scrypter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @scrypter
  • Status changed to Postponed: needs info 5 months ago
  • πŸ‡©πŸ‡ͺGermany christianadamski Berlin, Germany

    I never worked with the D7 version, I started D8+.

    But the actual DB structure looks very similar. What exactly did you try, and what was the result?

  • πŸ‡³πŸ‡ΏNew Zealand scrypter

    On the source D7 site I have geolocation and geolocation_googlemaps modules enabled.
    I was trying drush mim upgrade_d7_field. There are 264 fields and I get 1 fail, "Attempt to create a field storage field_location_map with no type".
    "field_location_map" is a D7 geolocation_latlng type field.
    On the D10 destination I have enabled geolocation and geolocation_google_maps.
    I am wondering if there is migration for this fairly basic situation?
    Thanks.

  • πŸ‡©πŸ‡ͺGermany christianadamski Berlin, Germany

    D8+ the field type is just "geolocation", not "geolocation_latlng". Maybe that's it?

  • πŸ‡³πŸ‡ΏNew Zealand scrypter

    Put this in modules/custom/my-migration/src/Plugin/migrate/field/d7/GelocationField.php

    namespace Drupal\my_migration\Plugin\migrate\field\d7;
    
    use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;
    
    /**
     * @MigrateField(
     *   id = "geolocation",
     *   core = {7},
     *   type_map = {
     *    "geolocation_latlng" = "geolocation",
     *   },
     *   source_module = "geolocation",
     *   destination_module = "geolocation"
     * )
     */
    class GeolocationField extends FieldPluginBase {
    
    ...
    
    }
    

    It worked! Hope this might help others. Still wondering if it should be in the contrib /geolocation module?

  • πŸ‡©πŸ‡ͺGermany christianadamski Berlin, Germany

    Ah, what exactly? Not too familiar with D7 - D10 migration. What exactly would you put where to enable what?

    Happy to commit something, if it might help others.

  • πŸ‡³πŸ‡ΏNew Zealand scrypter

    I pinged Damien McKenna and asked him to have a look, it seems both of us don't know the "best practice" solution here?

  • πŸ‡©πŸ‡ͺGermany christianadamski Berlin, Germany

    I see a whole bunch of migration D7 files in the geolocation_address sub-module. I do not remember writing those, so they where probably contributed by somebody.

    The are aimed to move location_cck fields to address fields through geolocaiton gecoders. So that is not what you want. But maybe still helpful?

    What exactly would be the goal here? Just get location_cck field data to geolocation and done?

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    I think you should plan out all of the different things that could be migrated, and work through the list one item at a time.

Production build 0.71.5 2024