Last updated November 22, 2013. Created on April 11, 2012.
Edited by Darren Oh, mikeryan, loopduplicate, scor. Log in to edit this page.

The central class in the Migrate module - the one you'll spend most of your time dealing with - is the Migration class. You derive your own classes from Migration, each of which represents the migration of data from a given source (such as a query against a source database) to a given Drupal destination (such as nodes of a specific content type, like 'article').

You embed in this class instances of four other classes:

  • MigrateSource represents the source data. The Migration class iterates over row objects generated by this class.
  • MigrateDestination represents the destination object (user, node, etc.). Each row produced by MigrateSource is manipulated and passed on to the destination class to create the object.
  • MigrateMap represents the relationship between source and destination objects, keeping track of precisely which source data record resulted in the creation of which Drupal object.
  • MigrateFieldMapping represents a mapping between a source field and a destination field. A typical Migration subclass will contain several field mappings.
  • Migrate module architecture

Looking for support? Visit the forums, or join #drupal-support in IRC.