Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Write a Simple Migration Class

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:07
    JOE SHINDELAR: In this lesson we're going
  • 0:09
    to start taking a look at importing player data into Drupal.
  • 0:14
    The first thing that we're going to need to do
  • 0:16
    is just write a simple SQL query against our source data
  • 0:20
    to figure out what we're going to select,
  • 0:22
    and how we're going to select it, and what rows it is that we're
  • 0:26
    going to be dealing with as an import.
  • 0:28
    Then we're going to implement a migration class in our new custom
  • 0:32
    module that will allow us to translate
  • 0:35
    that source query into a migration query.

Write a Simple Migration Class

Loading...

In this lesson we're going to write our first custom data migration and start importing some of the player data in to Drupal. The primary concepts covered in this lesson are the creation of a migration class following the pattern necessary for Migrate module to be able to discover our code and then dealing with defining source and destination objects so that the Migrate module will know where to read data from and where to write data to. Finally we'll add a simple single field mapping where we map the player's name to the node.title field allowing us to run the migration for the first time and import some real data.

Downloads: 
Log in or sign up to download companion files.