If I run drush migrate-upgrade --configure-only, using a Drupal 6 DB, and then run drush mi --execute-dependencies upgrade_d6_field the date fields are not getting picked up, and will not get migrated. They simply get marked as ignored.

I can realized that the field type date and datetime is not recognized by cckPluginManager nor the StaticMap.

I think that I can work around this by making this dirty change to this class, but that is obviously not a solution:

# /core/modules/field/src/Plugin/migrate/process/d6/FieldType.php
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
  list ($field_type, $widget_type) = $value;
  try {
    $mapped_to_field = $this->cckPluginManager->createInstance($field_type)
      ->getFieldType($row);
  }
  catch (PluginNotFoundException $e) {
    try {
      $mapped_to_field = parent::transform($value, $migrate_executable, $row, $destination_property);
    }
    catch (\Exception $ex) {
      if ($field_type == 'date' || $field_type == 'datetime') {
        $mapped_to_field = 'datetime';
      }
    }
  }
    
  return $transl_to;
}

I don't see any migrate plugins at here.

Are there no migration path for date fields yet?

Comments

tlyngej created an issue. See original summary.

tlyngej’s picture

Issue summary: View changes
tlyngej’s picture

Issue summary: View changes
tlyngej’s picture

Some example data for a date field not working:

From content_node_field_instance:
widget_type:
date_popup
widget_settings:
a:10:{s:13:"default_value";s:5:"blank";s:18:"default_value_code";s:0:"";s:14:"default_value2";s:4:"same";s:19:"default_value_code2";s:0:"";s:12:"input_format";s:5:"d/m/Y";s:19:"input_format_custom";s:0:"";s:9:"increment";s:1:"1";s:10:"text_parts";a:0:{}s:10:"year_range";s:6:"-23:+0";s:14:"label_position";s:5:"above";}
display_settings:
a:9:{s:6:"weight";s:3:"175";s:6:"parent";s:31:"group_certificate_form_personal";s:5:"label";a:1:{s:6:"format";s:6:"inline";}s:6:"teaser";a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}s:4:"full";a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}i:4;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}i:2;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}i:3;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}s:5:"token";a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}}
widget_module:
date

Data type of field in content_type_CONTENT_TYPE table:
varchar(20)
Sample data from that field:
2000-12-01T00:00:00

mikeryan’s picture

Status: Active » Closed (duplicate)
Related issues: +#2566779: Migration D6 > D8 of CCK date fields

There is an existing issue for this, had forgotten it: #2566779: Migration D6 > D8 of CCK date fields.