Upgraded from Drupal 6 to 7 or have a early Drupal 7 installation and there are a high change that you might still use the legacy Media field. This field used to be the only field that allowed us to use the media widget. It have since been replaced by a standard file/image field, provided by Drupal 7 core.
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](https://www.drupal.org/project/migrate) and [Drupal-to-Drupal data migration](https://www.drupal.org/project/migrate_d2d), 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:
More details are found in the official documentation at drupal.org.
An example of this is found in *article.inc*:
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*.
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.
### Blog post in this series
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.
In this example I will try to keep the amount of code to the very minimum. Putting too much features into a example have a tendency to put some people off with the amount of code it create. The example will not explain how you create new field types, but rather use one existing provided by Drupal core.
# Local dev. setup by using homebrew
Note:An quick, stort and easy starting point. Does not provide any background information outside the needed steps getting PHP, Apache and the database server running.
Tested on OS X 10.8.x/10.9.x.
Ever wanted to change the Drupal 7 markup? Get rid of all those pesky divs? If so, this is article for you. I will give you a simple example how to do this not by changing the site theme (template.php) but by using a theme function.