HackMonkey

Demystifying Drupal

Book Review: Migrating to Drupal 7

February 6, 2013 - 4:00pm

For all Drupal's features, power, and flexibility, there is one area it has issues with - Content Migration. Getting content into Drupal in mass or from an older Drupal version can be brutal. So far each version of Drupal has had some sort of support for upgrading between versions included, but the chances of success can waver depending on how complex a site is and the modules used. Over the years a couple modules have risen to the challenge of addressing the migration problem, Feeds and Migrate

Migrating to Drupal 7 from Packt Publishing, and authored by Trevor James, tackles the often challenging task of getting content into Drupal from an outside source, and avoiding countless node/add forms. The books cover states "Learn how to quickly and efficiently migrate content into Drupal 7 from a variety of sources including Drupal 6 using automated migration and import processes."

Who this book is for

This book is for Drupal users, website managers, webmasters, content editors, or developers who have already installed and configured a Drupal site and understand its web-based administration; and who want to import data from other sources and websites into the Drupal framework.

This book will have little in terms of programming or code. Everything we do in the book will be configured easily by using the Drupal administration interface and module admin screens. We will look at some code briefly when we set up our Feature modules. You do not need to have any previous MySQL or PHP experience to work through these examples.

I want to call out "Who this book is for". Migrations aren't for the faint of heart and are a fairly advanced topic. I am not sure that is properly expressed above. "Drupal users" is pretty vague, and typically Content Editors are not behind the scenes folks, rarely will they be the people installing and configuring Drupal. However an intermediate site builder will do just fine with this book.

The book doesn't waste any time tediously explaining Drupal or how to install it, an advanced topic book shouldn't require it. Chapter 1, "Preparing Drupal for Content Migration", does touch on tweaking PHP memory, although focuses mostly on MAMP. The next 8 pages go on to detail how to install Admin Menu, CTools, Views, Job Scheduler, Features, Feeds, and Feeds Tamper. Considering the target audience should be familiar with Drush, this could have been shortened considerably, by omitting the install instructions and just explain why we needed the module and a brief synopsis. Note: The CSV file was not where the book said it would be in the sample files I downloaded. Instead it was in 0540OS_08/code/migration6/sites/$new_url/files/feeds/.

Chapter 2 is titled "Starting a Migration Path". It briefly talks about planning content types around the data to be imported, but focuses mostly on preparation for the supplied CSV file and less on theory. Again, some of the steps are more detailed than needed for an advanced topic book. More modules are introduced, without install instructions: Location, Location Feeds, Link, and References. A simple content type is created around the CSV, step-by-click-by-click.

Chapters 3, 4 & 5 deal with setting up, running and altering a Feeds import. This is the core of the book in my opinion. It does a good job running through things and explaining what is going on. Considering how detailed some of the earlier mundane steps where, there are a few things that feel a bit over assumed, but an experienced Drupaler should be able to figure them out. One thing that threw me was after preparing the import, "To run the import you need to go to the import URL for your site". This actually means /import. An Import link is also added to the Navigation menu, assuming you still have that block active - it is one of the first things I remove. A better wording or simply changing the sentence to "...URL for your site, 'mysite.com/import' ", would have saved me a trip the Feeds documentation and reading through the project documentation to figure it out. Reading the documentation on a module is always a good idea, but this feels like an oversight. Since the link isn't in the Admin area, it wouldn't have hurt to point out a somewhat irregularity from typical Drupal module admin structure.

Note: Feeds 2.0 has been released since the book was released, and the UI has changed slightly.  The book leads you to believe that referenced nodes will be created on import. Referenced Taxonomies do get created, but try as I might, I couldn't get the referenced nodes to be created. So my imports failed until I manually created the 24 Organization nodes for the referenced node type. Maybe I did it wrong, but there wasn't sufficient coverage on the topic to create reliable expectations on the outcome of this. 

While covering Feeds Tamper, there are two ways to access the settings mentioned. As of beta 4 there is a bug that breaks the link on the top of the Mappings page. A fix has been committed in the dev release, which also alters the UI some; Tamper now lives on a tab.

Chapter 6 covers packaging up the Feeds settings and Content Types with Features so they can be moved from a dev site to production.

Chapter 7 introduces the Migrate module as an additional method of importing content. It runs through importing the sample data included with the module. I am not really sure much is accomplished with this, as all the data is actually in the code included with the module. Migrate is a beast and requires coding to make it do anything and is considerably more complicated than Feeds. It also can be used to build on top of, such as the Wordpress Migrate module does later in the book. However the book doesn't go any deeper than that, and I suspect the only reason Migrate is covered as such is to provide a segue for the Wordpress Migration. However, for that reason this chapter should have been pushed back with the Wordpress chapter. Migrate is a beast, worthy of its own 100+ page book, so the dozen pages here really don't get you far. For a deeper look into Migrate, there is the Drupal.org community documentation and there was a technical session presented at Dupalcon Denver.

Chapter 8 really just rehashes the "official" method of upgrading Drupal 6 in place to Drupal 7. I was hoping there would be some alternative processes presented on doing this, as the upgrade can be quite troublesome for more complex sites. However unlike the official instructions included in the Drupal 7 UPGRADE.txt, the book introduces the use of the Upgrade Status module and the Drupal 7 CCK module as helpers. If you read enough about the upgrade on Drupal.org you will learn about these 2 modules, however UPGRADE.txt doesn't mention them. Upgrade Status is very helpful in getting a site ready to upgrade and identifying blockers. Fields moved into core with Drupal 7, instead of handled by CCK as in Drupal 6. So the Drupal 7 CCK module is used to convert them. I have ran through this upgrade a couple times with Upgrade Status and CCK before reading this book. The information on Drupal.org was a bit clunky and no where near as concise as it is presented in the book. I accomplished the upgrade following the steps in the book in record time!

Chapter 9 covers using the Wordpress Migrate module, which is dependent on the Migrate module. As such, swapping the Migrate chapter to follow the Core Upgrade chapter would make more sense to me. The chapter does a good job describing the process, unfortunately there are no sample files included. It would have been nice if the WXR export that was used in the book had been included in the code samples. I was able to pull an export from a clients existing Wordpress site and run through importing it into Drupal with decent success.

Conclusion

It is worth noting that both the Feeds and Migrate methods only bring over content, not menus. So there will still be work required to piece together the data imported.

The book does a very good job going through the process of importing with the Feeds module. It also covers the official D6 to D7 upgrade process in a very clear and easy to follow manner. The chapter on Wordpress to Drupal is a nice bonus. Additionally, it does that all in a manner that doesn't require coding skills. So an intermediate site builder should be able to handle them fine. 

However, the chapter on the Migrate module doesn't really do much beyond lay the ground work for the Wordpress chapter. Migrate really needs its own book, which requires considerable knowledge of coding and Drupal APIs. 

There are several screenshots that show content that isn't covered till later in the book, and a few places where it is assumed you have already created some fields and content types. With a little editing, omitting some unneeded tedious steps and shortening up the Migrate part, the book might have been reduced in size to about 100 pages.

Disclaimer

The copy of Migrating to Drupal 7 that was used for this review was provided at no charge to Scott Wilkinson of HaloFX Media LLC by Packt Publishing. However, no other compensation was received for this review and this review was published without prior review or any influence from Packt Publishing.