Tried upgrading D6 to D7. Couldn't migrate Select (or other) fields with CCK migration module. They generated the following error:
_______________
Error creating field field_my_field_name
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') NULL DEFAULT NULL, `field_my_field_name_format` VARCHAR(255) NULL DEFAUL' at line 9' in /my/path/docroot/drupal7/includes/database/database.inc:2171 Stack trace: #0 /my/path/docroot/drupal7/includes/database/database.inc(2171): PDOStatement->execute(Array) #1 /my/path/docroot/drupal7/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array) #2 /my/path/docroot/drupal7/includes/database/schema.inc(661): DatabaseConnection->query('CREATE TABLE {f...') #3 /my/path/docroot/drupal7/includes/database/database.inc(2720): DatabaseSchema->createTable('field_data_fiel...', Array) #4 /my/path/docroot/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.module(216): db_create_table('field_data_fiel...', Array) #5 [internal function]: field_sql_storage_field_storage_create_field(Array) #6 /my/path/docroot/drupal7/includes/module.inc(866): call_user_func_array('field_sql_stora...', Array) #7 /my/path/docroot/drupal7/modules/field/field.crud.inc(180): module_invoke('field_sql_stora...', 'field_storage_c...', Array) #8 /my/path/docroot/drupal7/sites/all/modules/cck/modules/content_migrate/includes/content_migrate.admin.inc(246): field_create_field(Array) #9 [internal function]: _content_migrate_batch_process_create_fields('field_my_field_n...', Array) #10 /my/path/docroot/drupal7/includes/batch.inc(284): call_user_func_array('_content_migrat...', Array) #11 /my/path/docroot/drupal7/includes/batch.inc(161): _batch_process() #12 /my/path/docroot/drupal7/includes/batch.inc(80): _batch_do() #13 /my/path/docroot/drupal7/modules/system/system.admin.inc(2373): _batch_page() #14 [internal function]: system_batch_page() #15 /my/path/docroot/drupal7/includes/menu.inc(517): call_user_func_array('system_batch_pa...', Array) #16 /my/path/docroot/drupal7/index.php(21): menu_execute_active_handler() #17 {main}
____________________

Comments

couturier’s picture

I know this is probably not the answer you want to hear, but if you wait until Drupal 8 comes out, the migration path from D6 to D8 is going to be tons smoother than that from D6 to D7.

If you absolutely must upgrade now, then I would recommend just cutting and pasting to transfer content into a completely new site. I had about 1,000 URLs and lots of custom content types on my D6 site, but it really didn't take that long to build a new D7 site from the ground up, and it was much easier for the migration.

Another option is to pull your D6 content into the new site via database form, but I'm not experienced with the technical details of how to do it.

gintass’s picture

Thank you for the answer. Copy/paste is definitely not an answer for me. So far the only field that I couldn't migrate with CCK migration tool is "Select (or other)". I hope that someone know how to solve that, but if that is not possible, I'd rather export and import all my data.

Thank you for letting me know about the possibility of skipping D7. I didn't know that this might be possible, since in the official Drupal upgrade documentation I saw this statement that "you first need to upgrade to Drupal 7 before you upgrade to Drupal 8". Now I see some articles stating that starting with D8 you will be able to skip a version. That sounds interesting.

couturier’s picture

Yes, in fact many Drupal 6 sites are choosing not to upgrade to Drupal 7 because of the migration path to Drupal 8. If possible, I would keep your site in Drupal 6 until Drupal 8 is released. The migration from 6 to 7 can be difficult, but it will be easier from 6 to 8.

Read more about it here: https://www.drupal.org/d6-lts-support

gintass’s picture

Problem solved. I think I forgot to enabled the Select (or other) module before starting field migration process. Now I enabled it and all fields, including Select (or other) were migrated without any problem.

gintass’s picture

Category: Bug report » Support request
Status: Active » Closed (fixed)
arx-e’s picture

I have the same problem and it is not because I have not enabled the Select (or other) module.
With the module disabled I get the same error too.
Any ideas?

Error creating field field_bd_beach_type
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') NULL DEFAULT NULL, `field_bd_beach_type_format` VARCHAR(255) NULL DEFAULT NUL' at line 9' in /home/blueflag/public_html/admin/includes/database/database.inc:2171 Stack trace: #0 /home/blueflag/public_html/admin/includes/database/database.inc(2171): PDOStatement->execute(Array) #1 /home/blueflag/public_html/admin/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array) #2 /home/blueflag/public_html/admin/includes/database/schema.inc(661): DatabaseConnection->query('CREATE TABLE {f...') #3 /home/blueflag/public_html/admin/includes/database/database.inc(2720): DatabaseSchema->createTable('field_data_fiel...', Array) #4 /home/blueflag/public_html/admin/modules/field/modules/field_sql_storage/field_sql_storage.module(216): db_create_table('field_data_fiel...', Array) #5 [internal function]: field_sql_storage_field_storage_create_field(Array) #6 /home/blueflag/public_html/admin/includes/module.inc(866): call_user_func_array('field_sql_stora...', Array) #7 /home/blueflag/public_html/admin/modules/field/field.crud.inc(180): module_invoke('field_sql_stora...', 'field_storage_c...', Array) #8 /home/blueflag/public_html/admin/sites/all/modules/cck/modules/content_migrate/includes/content_migrate.admin.inc(246): field_create_field(Array) #9 [internal function]: _content_migrate_batch_process_create_fields('field_bd_beach_...', Array) #10 /home/blueflag/public_html/admin/includes/batch.inc(284): call_user_func_array('_content_migrat...', Array) #11 /home/blueflag/public_html/admin/includes/batch.inc(161): _batch_process() #12 /home/blueflag/public_html/admin/includes/batch.inc(80): _batch_do() #13 /home/blueflag/public_html/admin/modules/system/system.admin.inc(2377): _batch_page() #14 [internal function]: system_batch_page() #15 /home/blueflag/public_html/admin/includes/menu.inc(517): call_user_func_array('system_batch_pa...', Array) #16 /home/blueflag/public_html/admin/index.php(21): menu_execute_active_handler() #17 {main}

haydeniv’s picture

Status: Closed (fixed) » Active

I field_bd_beach_type_format a select or other field?

arx-e’s picture

Yes, it is!
I have done the upgrade one more time from scratch and I have the same result: the 6 "select or other" fields give this error and do not migrate. All other fields were migrated OK.

At some point I tried to manually edit the "other" values in the database replacing them with null but I had the same error message and failure to migrate.

haydeniv’s picture

What version of Select or Other do you have installed on your Drupal 7 site?

arx-e’s picture

I tried initially with 7.x-2.20 and then with 7.x-2.20+1-dev - same results.
I didn't try the 7.x-3.x-dev. Do you think this one could work?

haydeniv’s picture

No don't use 7.x-3.x-dev it is very unstable right now.

How many select or other fields do you have? You may want to try converting the formatters back to Text on those fields on your Drupal 6 site prior to doing the upgrade. Run the upgrade and then turn the formatter back to select or other. You may need to reconfigure the settings for each of the fields after the upgrade but it should get you upgraded. Also make sure and clear you cache prior to running the upgrade.

arx-e’s picture

Thank you haydeniv!
I only have 6 fields and it doesn't pose much of a problem, so I will probably re-create them. Just wanted to know whether there was some known solution for this.

haydeniv’s picture

Status: Active » Closed (fixed)

I believe there is a core bug responsible for this but I'm not sure which. This module does not actually install any updates during a core upgrade. Hopefully Drupal 8 will make this process smoother.

grzesag’s picture

I think I have similar problem - fix for me was to set "Maximum length" under field settings to 255 on Drupal 6 and after D6 to D7 upgrade Migrate Fields went without this error

kyoder’s picture

Component: CCK / Field API widget » Field widget (non-specific or listed)

The patch here https://www.drupal.org/node/2854669 fixed this for me.

kyoder’s picture