Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
years ago i created a CCK FileField... I used this field for uploading images.
Now, i want to migrate to Drupal7, and the only way to convert that CCK FileField into a D7 ImageField would be to convert tthe D6 FileField into an ImageFIeld first.
Is this possible? Can i use the "core upload" migration script?
Comments
Comment #1
quicksketchI'm not really sure why that would be, but you can change a filefield into an imagefield just by changing the widget on the field. An ImageField *is* a FileField, just with a different upload widget. The data storage for both types of fields is identical, so I'm surprised that you would need to "convert" from one to the other, since they both have the same data.
Comment #2
Sifro CreditAttribution: Sifro commentedcool, it was very easy, and the migration was succesful. Thanks.
Comment #3
quicksketchComment #4
kevinsiji CreditAttribution: kevinsiji commentedI realized this hurdle in the middle of a migration. Instead of going back to D6, change the field widget and starting all over again, I went and edited the table
"content_node_field_instance"
in the db.Find the row for my filefield(for an image), and SET
`widget_type` = 'imagefield_widget'
. Also updated the serialized data in`widget_settings`
accordingly (copied from another image field.)Comment #5
CobraMP CreditAttribution: CobraMP commentedthank you #4 -
unconverted my field
went to phpmyadmin and changed the widget type from filefield_widget to imagefield_widget
didn't even have to change the field type
on convert it fixed all my fields to field type image.