Handling Drupal terms during a Drupal to WordPress migration
When migrating Drupal terms into WordPress, it's important to understand exactly what terms are and how the two systems handle categorising information.
A primer on Drupal taxonomies
One of Drupal's most powerful features is its ability to organise content with taxonomies. Unfortunately, the taxonomy system is also notorious as one of the trickiest things about Drupal for beginners to understand. You can find a more detailed explanation here but essentially, a taxonomy is the practice and science of classifying things. In content management terms, you would mostly use taxonomies to organise and categorise articles or posts. Taxonomies in Drupal uses the concept of vocabularies and terms. Terms are just a list of words that describe a particular type of content. They're grouped together into vocabularies, which can be thought of as 'containers' for a set of terms. Vocabularies may be assigned to any content type. Drupal allows you to arrange the terms within a vocabulary using a parent-and-child hierarchical structure or they can be a flat list, with each term being on the same level as the others. You can have many vocabularies in Drupal, each containing any number of terms. Vocabulary names must be unique and you cannot have duplicate term names within a vocabulary. It's possible, however, to have the same term name appear in different vocabularies. Fig. 1 shows an example Drupal taxonomy with three vocabularies, Music, Movies and Books. The Movies and Books vocabularies both have the term Sci-Fi.
[caption id="attachment_190" align="aligncenter" width="284"] Fig 1: Drupal vocabularies and terms[/caption]
For more information about the Drupal taxonomy system, please see Organizing content with taxonomies.
WordPress categories and tags
WordPress' system for organising content is simpler. You have the option of categories--which can be hierarchical--and tags which are flat, or non-hierarchical. In general, categories in WordPress are used as a way of broadly organising posts and tags are used for more detailed descriptions. Unlike Drupal, where you can have many containers in the form of vocabularies, a standard WordPress installation offers one container for categories and one for tags. Also as standard, categories and tags can only be assigned to the WordPress post content type. A WordPress developer can extend this by creating custom content types with their own categories and tags. Fig. 2 shows show you'd organise the Music, Movies and Books categorisation in WordPress.
[caption id="attachment_191" align="aligncenter" width="191"] Fig. 2: WordPress categories and tags[/caption]
Migrating Drupal terms as WordPress categories and tags
When running a Drupal to WordPress migration, we need to map Drupal's more complex multi-vocabulary taxonomy system into the simpler WordPress model of categories and tags. How we do this depends on how you want to organise your new WordPress site. For example, we can:- convert Drupal vocabulary names into WordPress categories and Drupal term names into WordPress tags;
- convert Drupal terms into WordPress categories and sub-categories;
- vocabularies and their associated terms.
[caption id="attachment_195" align="aligncenter" width="488"]Fig 3: Merging Drupal taxonomies into WordPress[/caption]
Since WordPress doesn't support duplicate category or tag names, another thing to consider is how to handle any duplicate Drupal terms. Normally, the easiest solution is to append a unique number so that you can filter them out post-migration. We can do some clever merging and re-assigning of terms to posts but frankly, it's probably not worth incurring the extra fees. Unless you have a great number of duplicates, you can probably do the job yourself quite easily via the WordPress Dashboard controls.