Data Migration into Drupal: Session Recap from DrupalCon London
This is a live blog of the session “Data Migration into Drupal” by Moshe Weitzman at DrupalCon London.
This session was packed! I got the last seat in the overflow – a very popular topic for Drupal.
Introduction to the Migrate Module for Drupal
Using the Migrate module it is possible to import data from a number of different CMS systems.
A migration is a collection of a given source to a given destination ie: each content type would be a separate migration. So that means that authors, articles, taxonomy/terms etc. are all separate migrations.
They demo’d a migration from a MySQL database into the Drupal database.
Mapping is built in.
Data Sources: MySQL, PostgreSQL, MS SQL, POracle, CSV, XML, JSO. There is lots of source code to write your own plugin
Destinations: Entities, Fields, Contrib, Database tables – easily create plugins for new ones.
Mappings: $this->addFieldMapping(‘show’,’status’) -> defaultValue(0); (simple version)
During the session, a lot of code was thrown up on the screen and hence impossible to reproduce in the blog. The session will be available at Drupal.org in due course.
Some of the highlights
Migrator will process 1700 items per minute. Successes and failures are logged.
Map is a table that migrate maintains and keeps track of every Primary Key from the old system, mapping it to the Primary Key in the Drupal database. So if you had a key field called “aid”, it would be mapped to userid in Drupal for the users table.
*note* – Migrate allows you to roll back any data imports that may not have worked properly.
dedupe – prevents identical fields content from being put into Drupal where it requires a unique field.
You *can* map a multiple entry field in Drupal.
Your list of migrations CAN’T be run in just any order. For example, users must go before content in order to link articles to their author.
Data Migration is definitely not for the Drupal beginner. If you’re considering a move from WordPress, Joomla or some other database driven site, this could be a great tool – and there are some great companies that can help you. That said, the Migrate module is the place to start.