0

I have successfully migrated content into nodes/paragraphs from Excel spreadsheets (using the awesome https://www.drupal.org/project/migrate_spreadsheet module) although it's not really any different if it was CSV. However, the paragraphs had a 1-1 correspondence with the nodes and it was easy to import the data as a single row. Now I need to migrate content where the nodes have multiple paragraphs attached. I'm initially stuck on how the to use the paragraphs reference to its parent content. It seems like each piece of content has its own unique ID, UID, which is stored in the migrate mapping tables to its corresponding Drupal content ID. But how does the paragraphs's parent id get used? Do I need to import that as a separate field and then do a lookup? Do I need a create a custom plugin for this?

Let's say I'm attaching a Song paragraph type to a Album node.

Albums (node) UID, Title 1, Title 1 2, Title 2

Songs (paragraph) UID, Album ID, Title 1, 1, Song 1 2, 1, Song 2 3, 2, Song 1

Album ID in the Song data is the reference to the Song's parent, which is the UID in the Album data. I'm not clear on how to import the "Album ID" data in Songs and reference it when I import the Albums data.

  • You need to migrate the songs first then the albums. Maybe this article fourkitchens.com/blog/development/migrating-paragraphs-drupal-8 helps – Clemens Tolboom Sep 15 '18 at 12:12
  • @ClemensTolboom agreed that it's two separate migrations - first songs, then albums. The issue is - how do songs get mapped to albums? It's easy if there's a 1 to 1 correspondence - ie. one song per album. But how is it done if there are multiple paragraphs (song) per node (album)? – codesmith Sep 19 '18 at 18:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.