The process is really simple and sound for a PHP programmer. Currently there is an issue in CCK but there isn’t one here. A path with some code has already been established see: http://blog.urbaninsight.com/2012/02/28/migrating-drupal-6-multigroups-d.... As wonderful as this blog article is, it demonstrates a non-automated, PHP experience required, make your own module, list of instructions that aren’t fool proof and friendly to non-programmers. It would be nice to be able to perform this migration using Field Collections. Currently the only other alternative is a manual migration of the data.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Priority: Major » Normal

As much as I agree with this issue, and I'd really like to see this happen... and I'll eventually need this when I upgrade my own site...

I have to change the priority of this posting. It does not meet the guidelines for a "major" issue against this module. Setting it to "normal" for the time being.

We should also mention the original issue on the CCK/multigroup page: #1056188: Create upgrade path for Multigroups

I'll let someone who works on field_collection adjust the status as they see fit... it is probably still worth having a discussion over here but I sorta feel like this is a duplicate of the issue that properly belongs to multigroup/CCK.

colan’s picture

Component: User interface » Code
Issue summary: View changes
Status: Active » Needs review
FileSize
9.32 KB

Here it is, folks!

When you install Field Collection, it should now convert all CCK Multigroup data if it exists in the database.

I'd especially like to thank Gergely Lekli for providing the conversion code. I took it and wrapped it in some automation.

Enabling Field Collection must happen after Content Migrate does its thing, so don't enable it until after the general field migration happens. We need to document this in the handbook over at Migrating D6 Content Construction Kit (CCK) to D7 Fields, the Field Collection project page and the CCK project page once it's finalized.

For now, you'll have to delete the independent fields used in the collections manually, after the conversion happens. We could always do this at the end of the conversion, but I didn't want to put anything too destructive in there just yet.

I suppose this would be best rewritten as a batch job, but I wanted to get something working first.

amcc’s picture

im getting an error at installation with this:
FieldException: Attempt to create an instance of a field field_recording_artist that doesn't exist or is currently inactive. in field_create_instance() (line 476 of mysite.dev/modules/field/field.crud.inc).

i dont have that table in the db - i do however have content_field_recording_artist. It might be a problem with the content migration perhaps - im using drush site-upgrade command (http://www.acquia.com/blog/use-drush-upgrade-drupal-6-drupal-7) and it did run into some errors during that process, but completed.

My drupal 6 site has 180 tables and my drupal 7 site has 499 after the migration perhaps this isn't normal and something has gone wrong elsewhere. I'm trying to rule out one or the other. Any help would be great.

danielnv18’s picture

IT WORKS!!!. Thanks @colan, you just save lot of time.

Sylviak’s picture

Thanks Colan! Though I wonder why it is not reassigning Content taxonomy fields. Even after migration the fields are not there .. any workaround?

youngpac’s picture

this is not working for me. I'm quite frustrated. when i add the patch as a method in the file and run it. nothing is being populated in the d_field_collection_item and d_field_collection_item_revision any help?

danielnv18’s picture

@youngpac what I did was create a CVS feed import on D7 site and on the D6 site create a CVS (https://www.drupal.org/project/views_data_export)

youngpac’s picture

Thanks @danielnv18 but i can create a and export and an import but pardon me for my silly question.. exactly what will i be exporting to D7? this is because already the tables from D6 are there with content_group and content_group_fields which were being used by ccks multi group? what exactly should i export. thanks for your help

danielnv18’s picture

@youngpac In my case the patch help me but I lost data on some nodes so i have to use feeds to import the data from the d6 site to the new one

youngpac’s picture

@danielnv18 I see your point. In my case all the data is there. I go ahead and add the patch as instructed above. I run the install and enable of the field collection module. but nothing happens, the tables are created but not populated with the data from the old tables. im at a loss here. i have attached my field_collection.install. is that the way it should look?

youngpac’s picture

@danielnv18 I wanted to let you know that this finally worked. one thing others should note is that one should not have an empty group in the system. this will make the script not run well. at least for my case this was the issue.

danielnv18’s picture

@youngpac cool

wwedding’s picture

Updated #2 by @colan to include a catch for when a multigroup was used across multiple nodes. It was trying to create duplicate field instances on the field_collection entity as a result.

wwedding’s picture

Status: Needs review » Needs work

Passed testing but I'm switching it back to needs work on account of @youngpac mentioning that an empty multigroup caused trouble.

It also appears there needs to be more work in the logic that copies data around because I see random empty collections with data that should have been moved still sitting around in the original fields created after the CCK module's migration.

wwedding’s picture

Status: Needs work » Needs review
FileSize
12.4 KB

Updated the logic to be overly thorough instead of relying on the original assumption that the first subfield always had data. That assumption was not true on the install I'm migrating (and was probably the root cause of missing data reported by @danielnv18.

This could be made more efficient in many ways but in its current state the code is at least easier to follow than the extremely complex db_queries I was trying to come up with and it should only ever be running once, anyway.

danielnv18’s picture

I havent done this in some time but I'll try to test it this weekend

senthilnz’s picture

Hi,

I have a drupal 6 website with several multigroup fields, as D6 is not supported any more I have to migrate to D7, But it is difficult to migrate the multigroup contents. Can any one help me how can I migrate the data to D7?

Thanks in advance.