Drupal 7

How to migrate content from drupal 6 to 7 by using Migrate_d2d - Part 4 - field mappings

This is probably the last post in this series. I will try in this article to bring it all together. This will also be the most code heavy article. If you are new to migrate and Drupal-to-Drupal data migration, make sure you read and understand the first articles before preceding.

Mapping fields (field mappings)

Migrate have no way of knowing your plans for your Drupal 6 CCK fields or to what fields you are planning to store the data in Drupal 7. Perhaps you do not want or need to migrate all your old data. Source and target field have the same field name and type, but sometime you might want to fix a bad decisions made in the past and reorganize your architecture. Migrate call this field mappings. What ever reason you might have, you will need to share these ideas with Mirate. The basic format is like this:

$this->addFieldMapping('drupal7-field_name', 'drupal6-field_name')

More details are found in the official documentation at drupal.org.

An example of this is found in article.inc:

<?php
$this
->addFieldMapping('field_bar', 'field_foo');
?>

This map field_foo (drupal 6) to the cleverly named field field_bar (drupal 7). This is all it take to get a text field like this migrated if you re-run the node migration drush mi Article.

How to migrate content from drupal 6 to 7 by using Migrate_d2d - Part 4 - nodes

This series would be incomplete without also covering node migration. The example code is working code and should import data from drupal 6 to 7 if you have correctly configured your test setup by following the previously articles (part 1-3). Do not be scared by the code. It is more PHP defining stuff then "real" code containing a lot of logic and stuff.

How to migrate content from drupal 6 to 7 by using Migrate_d2d - Part 3 - files

This is the third part in a series of blog posts about how to use of migrate and migrate_d2d to migrate content and files from Drupal 6 to 7. In the third part will be about files. Part 1 - Some background information, setup and user migration. contains information about how migration in general works and the needed configuration.

How to migrate content from drupal 6 to 7 by using Migrate_d2d - Part 2 - taxonomy

This is the second part in a series of blog posts about migrate and migrate_d2d. I will in this post demonstrate how to migrate taxonomy terms from Drupal 6 to Drupal 7. Part 1 - Background, setup and user migration. contain information about how migration i general work and the needed configuration. Please make sure you read and understand it before attempting to follow this.

How to migrate content from drupal 6 to 7 by using Migrate_d2d - Part 1

The normal way of performing a major upgrade in Drupal have traditionally been by running update.php, that fire off a lot of rather complex hook_update_N() tasks. They will try to upgrade configuration and content from one major version to another. Example Drupal 6 to 7. This is all about to change in Drupal 8. Drupal 8 have got the migrate module baked in, and upgrade is no longer a upgrade, but a migration of data and configuration from one system to another.

Upgrade from Drupal 6 to 7, how hard is it?

Updates

  • May 2012 - One year have past since I initially wrote this article. Upgrading these days from Drupal 6 to 7 have become easier, safer, and a lot less nerve wrecking, though it will never become a cakewalk.
  • May 2015 - Started writing a longer series using Migrate and Migrate D2D.
  • May 2015 - Cleaned up language a corrected grammar erros.

To migrate or upgrade?

As writing do I still have a few more complex sites running on Drupal 6. Knowing these sites, their complexity, and all existing glue code, a fast and easy upgrade will be hard pull off. It might be easier for complex sites to only migrate the content using modules like migrate and migrate_d2d.

A data migration

  • Do a clean Drupal 7 installation.
  • Build basic needed content types and configurations.
  • Recreate the theme in D7 or port you existing CSS/SASS styles.

Then migrate your content by using modules like http://drupal.org/project/feeds, or for even more flexibility and power http://drupal.org/project/migrate. I'll promise do a blog post of a more complex Drupal 6 to 7 migration as soon as my remaining sites are running Drupal 7.

Pages

Subscribe to RSS - Drupal 7