Is it possible to migrate from D8 Field Collection to D8 Paragraphs?

Thanks.

CommentFileSizeAuthor
#17 feature_example.png53.82 KBVlad_S
#17 fieilds_list.png79.87 KBVlad_S

Comments

tjferre created an issue. See original summary.

tjferre’s picture

Any guidance on this?

juampynr’s picture

Are you talking about updating the database so the data goes from field collections to paragraphs or migrating from a d8 that uses field collections to a d8 that uses paragraphs?

You could use the latest patch from #2897021: [META] Migrate support for importing field collections as paragraphs at this issue as the foundation but obviously the sources would change. If this is a migration then the source would be the other d8 site but if the source is the same site you would have to specify that the source is using the same database as the destination in the source plugin that you would write.

tjferre’s picture

Migrating from a d8 that uses field collections to a d8 that uses paragraphs

sseto’s picture

Hey tjferre,

Know this is a 12-month post, but was wondering if you figured it out?

Thanks!

lberrie’s picture

Hey everyone,
I am also curious about this. I would like to migrate from D8 field collections to Paragraphs by the end of the month (work timeline reasons) and any guidance would be extremely useful. If I find a solution that's more than "manually copy fields and try to SQL your way to victory" I'll update in here.

penance316’s picture

@Iberrie did you make any progress on this?
I am looking to do the same thing and currently just thinking to do it in code.

thanks

damienmckenna’s picture

Category: Support request » Feature request

Let's make this a feature request.

damienmckenna’s picture

teknorah’s picture

Found a WIP helper module for this: https://www.drupal.org/project/field_collection_to_paragraphs

I am testing on my local and will let you all know how it goes!

damienmckenna’s picture

I wonder field_collection_to_paragraphs could be rebuilt as a Drush command that did the following:
* Recreate the FC types as Paragraph types.
* Copy the data from the FC tables to Paragraph tables.
* Convert the field configuration in-place.

wim leers’s picture

Huh — we've been doing a lot of work a year ago to make this work: see @huzooka's comments and patches at #2911244: Field collections deriver and base migration. It even got merged last August.

So AFAICT it's fully working.

I think this is just a duplicate that people lost track of?

EDIT: also, a complication here is that that was committed so long ago but it never shipped in a paragraphs release: https://www.drupal.org/project/paragraphs/releases/8.x-1.12 is the latest release and is over a year old. So perhaps the problem is that people are simply not discovering that committed migration?

damienmckenna’s picture

That's likely, Wim. I think documentation would help too. I have to do this for a project soon, so I'll start looking into it (instead of writing some Drush commands).

damienmckenna’s picture

Component: Code » Documentation

Looking at the "remaining tasks" of #2911244 it seems like documenting how to do this was the last item, besides some bug fixes.

Vlad_S’s picture

Good day!
Have an issue with bundle types. Content from Field Collection not migrated to Paragraphs. How I can do it using config parameters etc?

damienmckenna’s picture

FWIW I did some work on field_collection_to_paragraphs and got it to the point where it works on simpler use cases for both FC 8.x-1.x and 8.x-3.x, Your Mileage May Vary (YMMV).

Vlad_S’s picture

StatusFileSize
new79.87 KB
new53.82 KB

I have list of fields where two Field Collection fields exist (fields_list.png)
Then going to block (Feature for example in my case), and see, that Feature Paragraphs type not created (feature_example.png)

Could you please get advice what I need to do to migrate content to appropriate Paragraphs type?

Vlad_S’s picture

Good day!
What should be decision instead of manual content import?