Like Cheek in #781088-20: Updating CCK Fields and Data from D6 to D7

Sorry, I don't know which video is causing the problem, I have about 1500 videos.

The problem is pretty straightforward though. The text field is set to 'longtext' in the D6 database. The migration module is trying to copy the data into 'varchar(255)' field and it doesn't fit because it's smaller.

Probably line 319:
$field_value['settings']['max_length'] = 255;

I'll run a php script to substr() my fields to 255 and run the upgrade again to test when I have the time..

And Stol in #781088-148: Updating CCK Fields and Data from D6 to D7:

like #20 I cannot update my fields because 'longtext' columns are converted to varchar(255)

There seems to be an issue with longtext columns not being migrated to the proper field.

CommentFileSizeAuthor
#3 1078804-3.long-text-not-varchar-255.patch1.42 KBdww
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stol’s picture

I added a 'case:' switch at line 63 in 'content_migrate.text.inc'. Like this:

case 'text_textfield':
          $field_value['type'] = 'text_long';
          unset($field_value['settings']['max_length']);
          break; 

If someone wants to check this to make a patch?

steinmb’s picture

Subscribe

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
FileSize
1.42 KB

Ran into this myself during a migration I'm attempting right now. Here's the patch I used. You don't just always want to use long_text -- varchar is faster if you can get away with it. But, in cases where you have text fields without a max_length, truncating to 255 can't work. See the inline code comments.

KarenS’s picture

Status: Needs review » Needs work

So here's the problem. There are two widgets in D6, 'text_textfield' and 'text_textarea'. If you want a longtext field you should have been using the 'text_textarea' widget. If you do, the field gets converted correctly with the code as it is. If you have a longtext field that uses the 'text_textfield' widget, there is a problem with your D6 data.

The migration code assumes you have the right widget and makes the field type selection based on that.

So how did you end up with the wrong widget? Why would you use a textfield widget for longtext data?

KarenS’s picture

Hmm, after trying this out, I see it *is* possible to create a longtext field in D6 when using a textfield widget, for whatever reason you would do that. So maybe we need this. I'm trying to figure out various ways the data might be configured in D6 to make sure it makes it to D7 in the same format.

KarenS’s picture

Status: Needs work » Fixed

Committed this, or pretty close to this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

asb’s picture

sub