Getting your data into Drupal

Matt Corks | mvc |


Typical use cases

A quick history

Why not just write a quick script?

Feeds vs. Migrate 2.x


Feeds Overview

Fetchers (data sources)

File, HTTP, PubSubHubbub
Feeds SQL, LDAP, Directory fetcher (to find new files), etc

Feeds Overview

Parsers (data normalization)

RSS, CSV, OPML, Sitemap
XPath Parser, Flicker, YouTube, WordPress, LDAP, etc

Feeds Overview

Processors (data storage in Drupal)

Nodes, taxonomy terms, users, feed nodes
Comments, commerce products, database tables

Feeds Tips

feeds_dbg() prints to /tmp/feeds_example_org.log when the feeds_debug variable is TRUE

Use a Feeds tamper 'Find replace REGEX' to import local images:

REGEX: @.*/(.*)@
Replacement: file:///path/to/feeds/images/$1

Feeds Tips

Use Feeds tamper's 'String to Unix timestamp' to import dates as node creation or modification times

Associate nodes with their translations using hook_feeds_after_import()

Use the Feeds XPath Parser module with the Chrome XPath Helper extension

Feeds Tips

Node reference field support:

Drush integration:

Feeds Demo

Migrate 2.x

Migrate 2.x Overview

Creating a Migrate Class

Creating a Migrate Class

Learning to use Migrate

  • Creates taxonomies and content types
  • Imports nodes, users, comments, terms from SQL & XML sample data

Migrate Demo