We need to start to identify the upgrade path for Multigroup data. You can upgrade the individual field data as separate fields, but you will lose any synchronization of the values across fields. And if you have empty values they will get collapsed out.
Either Field group module or Field collection module are likely candidates, but there may be others.
What has to be done is this:
1) Create something equivalent to the multigroup using one of the D7 modules.
2) Figure out how you would map the data in the D6 tables to what you created in D7.
3) Write a patch that would handle that.
Comments
Comment #1
karens commentedStarted looking at this to see what is needed. The good news is I think the data storage model for field collections is similar enough to what we use in multigroup that this can be done. The fields are stilled stored in separate field tables, they will just have an entity of 'field_collection_item' and a bundle with the name of the field collection (and the name of the collection can be constructed from a combination of the name of the content type and the name of the group, to be sure we have unique names if the same group name was used on more than one content type).
Then we have to create the field collection entities themselves.
There is code at #1106182: Creating field collection programatically that might be useful.
Comment #2
karens commentedMore or less:
- Iterate over the items in the fieldgroup table of type 'multigroup'
- Create a new field collection item for each one, with the same weight as the original multigroup
- Iterate over the fields in the group
- See if the fields have already been migrated, if so, adjust the name of the entity type and bundle to the field collection entity type and name of the field collection item.
Remaining question, what to do with fields not yet migrated (perhaps because there is no D7 module available for them yet). Maybe add a hook to the field update process to see if a field collection has already been created for this multigroup and update the field values to use it. In that way any already-migrated fields will be adjusted when the collection is created, any not yet migrated fields will get fixed when they get migrated.
Comment #3
marcoka commentedsubscribe
Comment #4
asb commentedThank you for not abandoning multigroups - imho the greatest feature since the invention of CCK!
Comment #5
chriscalip commentedI am interested in d7 multigroup. Am I looking at the wrong repo
There doesnt seem to be a 7.x branch here.
Comment #6
yched commentedAs a 1st step, we should probably prevent the migration of the fields that are in a multigroup.
Core provides no support for moving fields (and values) from one entity type to another.
If those fields get migrated as "regular" fields (attached to the existing nodes), they will be impossible to move to the field_collection entities after the event.
+ Related (field_group issue queue) : #1226940: Migration of D6 fieldgroups also includes "multigroups"
Comment #7
yched commentedAnother reason why fields in multigroups shouldn't be migrated as the other ones :
- multigroups requires each field to be multiple
- in field_collection, it's the 'field_collection reference' field in the node bundle that is multiple, and each field within the field_collection bundle is single (one field_collection entity = one value for each field = one row of the multigroup). Well, field_collection lets sub-fields be multiple as well, but that's a case multigroups did not allow, so this won't happen during upgrades.
The tricky bit might then be if a D6 field was shared in several node types, and was part of a multigroup in only some of them. Then we can't decide whether the D7 field should be single or multiple...
Comment #8
yched commentedRight now I'm not sure there is another way than creating two separate fields in those cases :
- one for the instances outside multigroups (stays 'multiple', D7 instances stay on the node types)
- one for the instances inside multigroups (becomes 'single', D7 instances go on field_collection bundles)
One of them (probably the latter) will need a new field name, automatically derived from the original, which means some manual renaming in all the places (custom code, theme, views/panels definitions...) that refer to the field name... Ugh.
Comment #9
tomsm commentedsubscribing
Comment #10
zeezhao commentedsubscribing. Thanks for your work on this.
In relation to @KarenS' comment in #2, there are modules like formatted_number which I have used in multigroup in D6, and are not yet available in D7...
Comment #11
orgnsm commentedsubscribing
Comment #12
blasto333 commentedsubscribing
Comment #13
mjstone323 commentedsubscribing - and thank you! :)
Comment #14
glekli commentedI was looking for a way to migrate Multigroups to D7, but there did not seem to exist one. So I attempted to manually migrate existing data to Field collections. Here is what I did, I hope this helps:
http://blog.urbaninsight.com/2012/02/28/migrating-drupal-6-multigroups-d...
Comment #15
rbrownellThis issue needs some love!
Though that blog post is useful it is hard to follow if you don't know anything about PHP... Right now I am snagged on the "create your own module or insert into an existing module" step. :S Does anyone have any resources that they know of that can get me past that part?
Thanks;
-Ryan
Comment #16
rbrownellPosted feature request to Field Collection issue queue see: #1722450: Create path/tool/feature that upgrades data from D6 CCK3 Multigroup to Field Collection
Comment #17
steinmb commentedComment #18
colanThis would certainly be nice, but I'm not convinced that this is a critical issue as not everyone is using multigroups.
For now, #14 is the workaround.
Comment #19
colanI posted a patch for this to Field Collection over at #1722450: Create path/tool/feature that upgrades data from D6 CCK3 Multigroup to Field Collection.
Comment #20
maedi commentedFor those getting a 404 on the link in #14, here is the updated link:
https://www.urbaninsight.com/2012/02/28/migrating-drupal-6-multigroups-d...
Comment #21
senthilnz commentedHi,
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.