Warning message

Documentation is currently being migrated into the new system. Some pages might be temporary missing, and some guides might appear empty. Thank you for you patience while we are improving Drupal.org documentation.

Migrating D6 Content Construction Kit (CCK) to D7 Fields

Last updated on
August 18, 2016 - 20:27

Data must be migrated to upgrade Content Construction Kit (CCK) in Drupal 6 to Drupal 7 core fields. Much but not all of CCK functionality is now part of Drupal 7 core. Several features require the installation of new, dedicated 7.x modules.

The following instructions describe the steps necessary to migrate CCK for a site that was upgraded from Drupal 6 to Drupal 7. Learn more on upgrading from Drupal 6 to Drupal 7.

Upgrade Steps

The Migrate Fields page is divided into 3 sections:

Available fields- Fields that have not been migrated but are available for migration. Some fields will be listed as available, but may have attributes that will be lost (e.g., option widgets, permission setting for that field, the attached image) because the appropriate module has yet to be enabled. If you care about that attribute, enable the supporting modules BEFORE migrating the field.

Converted fields- Fields that have already been converted. You can choose to roll them back if the conversion did not work correctly. Note that rolling fields back will completely destroy the new field tables. This operation cannot be undone!

Unavailable fields- Fields that cannot be migrated because some modules are missing. Download and install/enable any required modules listed in the Other information column (aka Step 4) of this section.

Note: If you find that some image or file fields cannot be migrated, check to make sure that the Drupal Core 'field', 'file' and 'image' modules are enabled.

If you are getting "exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064" errors while migrating fields with autocomplete_widgets, you should install version 7.x-1.x-dev of Autocomplete Widgets for Text and Number Fields module as this is fixed in #1790758: PDO exception on migrate autocomplete_widgets longtext field.

  1. Download latest 7.x CCK module

    After upgrading to Drupal 7, download the latest 7.x CCK module version (http://www.drupal.org/project/cck). Typically this will be placed in your sites/all/modules or sites/example.com/modules directory.

  2. Enable the CCK Content Migrate module

    Browse to http://example.com/admin/modules and check the box next to Content Migrate in the CCK field group. Remember to press save configuration at the bottom of the screen. You may need to clear your cache in order for the Migrate fields option to be displayed in the next step.

  3. Browse to the Migrate fields page

    Browse to Structure > Migrate Fields or http://example.com/admin/structure/content_migrate for a page to walk you through the migration process.

  4. Download additional modules if necessary

    Typically these will be placed in your sites/all/modules or sites/example.com/modules directory. Be sure to back up your database and run update.php after enabling a module.

  5. Enable additional modules if necessary

    Browse to http://example.com/admin/modules and check all applicable boxes in the Fields section. Remember to press save configuration at the bottom of the screen.

  6. Migrate fields

Browse to Structure > Migrate Fields or http://example.com/admin/structure/content_migrate.

Check the box next to all fields you would like to migrate in the Available fields section.

Press the Migrate selected fields button.

If the migration process is successful you should receive a message detailing that each field was created. All fields should now be listed in the Converted fields section of the page.

Once the migration of all fields is done you can disable the module.

  1. Uninstall CCK Content Migrate module