I'm not entirely sure where this support request should live: Migrate Core, Migrate Plus, Entity Reference Revisions, Paragraphs or Migrate Source CSV. Entity Reference Revisions seems to be in the middle so I chose here. Feel free to move it.

I'm attempting to figure out how to import Paragraphs using the Migrate Source CSV plugin. I feel like I'm about 80% there, but need a nudge over the edge.

Here's my Migrate Plus YML file for importing my Paragraphs:

uuid: 88b8d4b8-0887-4dbf-884e-1d2483c3f2c1
id: import_paragraph_test_1
label: Import Paragraph Test 1

source:
  plugin: csv
  path: 'private://import_csv/paragraph_test_1.csv'
  header_row_count: 1
  keys:
    - id
process:
  field_number_1: number_1
  field_text_1: text_1
  type:
    plugin: default_value
    default_value: paragraph_test_1
destination:
  plugin: entity:paragraph

This does a great job of importing paragraph content, and the entry shows up in the paragraphs_item DB table just fine. However, if I look at migrate_map_import_paragraph_test_1, I notice that only the entityid is stored as the destid1 field. The revision_id should be stored in destid2, so that I can import revision_id when I go to import node content afterward.

How do I ensure that the newly created revision_id is stored in destid1, just as the newly created id is stored in destid1?

(Annoyingly, I managed to get this to work exactly once. drush migrate-import for my node content gave warnings about missing revision_ids, but the content was all there. As soon as I rolled it back, it stopped working and I haven't been able to get it working since)

I'm OK with abandoning Migrate Source CSV if I need to, but this feels like it should be part of the process or destination plugin, rather than the source plugin.

I feel like this is related to https://www.drupal.org/node/2809793, but I'm not sure how to get it all to work together.

Thanks in advance. :)

Comments

TrevorBradley created an issue. See original summary.

TrevorBradley’s picture

As an alternate solution, I'm presently looking into writing a Module Process plugin that takes in an entity_id as a source and returns the most recent revision_id. I'm not sure if I'm reinventing the wheel or building something useful for importing paragraphs.

heddn’s picture

That destination should be different. Something like: entity_reference_revisions:paragraph

heddn’s picture

Status: Active » Closed (duplicate)