Drupal 8

Drupal Sprint Cards

Announcing the sprint cards! My team created these cards as a condensed version of the DrupalCon Autsin mentor training. They summraize the top tasks needed for new contributors and coders and can be printed at any local print shop (usually in 12-24h) because we formatted them to be printed on standard business cards. So they are cheap to print and ready when you need them.

These cards have been seen at many Drupal events now and they get a good response wherever they go. The first sprint where they appeared was at the Jersey Shore (thanks again to the NJ team for bringing us there!) and they have since been at camps across North America and now at DrupalCon Amsterdam.

You can find them on our DrupalGive page, or use this handy PDF link.

Printing Specifications

Take this information to your local print shop.

  • Business card size (formatted for North America, so 3.5 × 2 inches... in metric that is 88.9 × 50.8mm [you may ask them to "scale" the PDF to your local size])
  • cardstock (thick paper)
  • matte (not glossy... sometimes people want to write on them)
  • double-sided
  • color
  • "no bleed" (extra cropping not necessary)
  • PDF file
  • quantity $x (most print shops have a special rate for different quantity, good to ask)

Migrating Drupal 8 in Europe

This week we're in Europe for DrupalCon Amsterdam! This is starting to feel suspiciously close to a beta so it is time to dive into Migrate again so you can start working on your new sites with real-world data. Let's begin!

What's up with migrate?

Migrate in the Drupal context means running a migration from the new Drupal 8 site and pulling data from an existing site. It replaces the old upgrade-in-place system that was used in prior versoins of Drupal. So do a fresh install of Drupal 8 and have an old Drupal 6 site on the same host. After you've logged into Drupal 8 you can connect to your Drupal 6 site.

How is Drupal 8 migrate different from Drupal 7 migrate (and migrate_d2d)?

In the older versions of Migrate the process invovled defining your field mappings and manually creating the new content types in the D7 system. This is no longer necessary.

Drupal 8 migrations will automatically create the needed content types and establish the mappings between the old and new fields by default. Therefore much less configuration is needed.

For times when it is necessary to customizae your migration you can use the included hooks or you can use the configuration schema to use the included plugins with your custom data set. The hooks go further than in D7, allowing you to alter data in the prepareRow stage without having to create a custom migration to deal with the data.

Migrate from Drupal 6? What about from Drupal 7?

Migrate frees us from the need to update each sequential version. You can leafrog versions! With Drupal 6 being close to end-of-life it is important to have a pathway for these users. For this reason, the D6 to D8 path was built first.

For Drupal 7: soon. This is now in-progress now that we are finalizing the Drupal 6 code.


  • Drush! The UI is still in a contrib sandbox, so for now you must use Drush. The latest version - from Github.
  • Composer. It is needed to install Drush. Go into the drush folder and run "composer install". Already installed? "composer update"
  • D6 Database. Have it on the same host as the new Drupal 8 install.
  • D6 Files. Probably a good idea to be on the same host. Can be file path or http(s) address.
  • D8 Database. A new, empty database. Use the old Creating the database howto if new to this.
  • D8 Files. Check out the git repo... unless of course a beta becomes available. Then use that.

Using Drupal Tools

If you do not currently have a Drupal 8 install one route to get there is to use the Drupal Tools for your platform. It includes all the software you need and the correct versions. It is available for Linux, Mac, and Windows.

If you install the Drupal Tools package it is not necessary to install Git, Drush, or Composer.

The installation should be current as it includes a version of Drush which must be up-to-date. So if you had installed Tools before, double check the version if you have any trouble.

Install Drupal8

Using the database credentials you created, install your new Drupal 8 site.

If you need to rebuild your site remember to delete your ENTIRE files folder and old settings.php. Reinstalling without doing this step will cause problems.

Install Composer / Drush

Make sure you have run the Composer installer. You should be able to type which composer and get a result in your terminal.

Check out the latest Drush. Go into the Drush folder and run composer install.

Next time you git pull (or git fetch) in the Drush folder, make sure to run composer update.

Find an isuse to test

  • Go to the Drupal project issue queue and filter down by Component: migration system, Version: 8.x.
  • Pick an issue that is not already fixed.
  • If you are sprinting with lots of people, pick something further down the list so you are not working on the same thing as someone else.
  • Read the posts. If it is easy enough you think you can handle it, post a comment to say you are doing some work on it.
  • Post the results of your tests.

Time to Migrate

Put the manifest.yml file with the migrations you wish to run in your D8 site root. Then go there on the command line and run the following command, using your D6 database credentials.

You can install Drupal 8 at this stage. If you do, be sure to enable all of the necessary modules. For example, if you use the Book module, it is not enabled by default, so you should enable it now or your book nodes will simply become a regular content type.

When Drupal 8 is no longer in beta the manifest.yml file will not be necessary unless you are doing some custom work. In most cases all that will be necessary is to put in the database credentials and the system will run all the migrations that the system knows about by default.

You will find a manifest.yml file attached to many Migrate issues that will enable you to begin the migration. Here is a sample of what I am using... I have added together many different issues and I run them all at the same time:

To get the complete list of available migrations run drush config-list|grep migrate

# user
- d6_user
- d6_user_profile_field
- d6_user_profile_field_instance
- d6_user_profile_entity_display
- d6_user_profile_entity_form_display
- d6_profile_values:user
- d6_filter_format
- d6_user_role
- d6_user_picture_entity_display
- d6_user_picture_entity_form_display
- d6_user_picture_file
- d6_user_picture_field
- d6_user_picture_field_instance
# taxonomy
- d6_taxonomy_vocabulary
- d6_taxonomy_settings
- d6_taxonomy_term
# nodes
- d6_node
- d6_node_revision
- d6_node_type
- d6_view_modes
- d6_filter_format
- d6_field_instance_per_form_display
- d6_field_instance_widget_settings
- d6_field_formatter_settings
- d6_field_instance
- d6_field
- d6_field_settings
- d6_node_settings
- d6_cck_field_values:*
- d6_cck_field_revision:*
# taxonomy fields
- d6_term_node_revision
- d6_term_node
- d6_vocabulary_entity_display
- d6_vocabulary_entity_form_display
- d6_vocabulary_field_instance
- d6_vocabulary_field
# blocks
- d6_block
- d6_menu
# custom blocks
- d6_custom_block
- d6_filter_format
# book
- d6_book
- d6_book_settings
# files
- d6_file:
    conf_path: sites/assets
    source_base_path: destination/base/path
    destination_path_property: uri

Now that you have created a manifest.yml file in the Drupal 8 root directory you can run the migration.

drush migrate-manifest --legacy-db-url=mysql://d6user:d6pass@localhost/d6 manifest.yml

If you are using Drupal Tools (Acquia Dev Desktop), and if you have also put your D6 site into Dev Desktop, you will need to specify the port number. You can find your database settings by creating an AcquiaDevDesktop terminal and typing drush status to get the exact settings for your D6 site. The result should look something like this:

drush migrate-manifest --legacy-db-url=mysql://drupaluser:@ manifest.yml

Note that the database user for D6 is called "drupaluser" and it uses the local IP address and port number rather than the host name. Again, run drush status if you are having trouble connecting to verify these values.


After you have run the migration check your work. Did things do what you expected? Post the results of your findings to the issue queue you of the item you were working on.

Was the result successful? If so, post the result.

Did something fail? Post the result.

Post your results! Don't be afraid to comment on Drupal.org. If you provide examples of your tests you will help the migration path improve.

Rolling back (starting over)

  • It is possible to re-run the migration. This can be helpful if you forgot to run a component, or if you have new items in the source site that you would like to add to the Drpual8 site.
  • To completely "roll-back" you really need to reinstall Drupal 8. To do this you must do three things: (1) empty your database, (2) delete settings.php, (3) remove the files folder completely.


Le sigh!

One problem you will run into at the moment is that using drush there is no way to set the path of the files directory from d6.

UPDATE: use the new manifest format in the code block shown above to set your file paths. It is the ONLY settings you will need in your manifest file.

The other solution is to use the migrate_upgrade contrib module (which will hopefully be part of 8.1). This module provides a URL at /upgrade which allows you to put database settings and file path. It does not let you select which migratiosn to run - they ALL run. So if you must test file migrations, this is the way (for now) but note that it is not as focused as the other testing methods.

Currently migrate_upgrade has some bugs! Look at the issue queue for the critical patches until the next update to migrate_upgrade is ready (at the moment the last version of that module dates back to June 2014).

Going further

Migrating into Drupal 8

These are the presentation notes from a "Migrating into Drupal 8" presentation I did at DrupalCamp Toronto 2014.

This discussion is focused on introducing the new concepts behind the new migration system that replaces the historic upgrade-in-place system we have used in previous versions.

Since many of these items are works in progress they are subject to change!

If you are working with D8 migrate now, keep in mind you will probably have to re-migrate at some point until the migration path is finalized. This may not happen until 8.1.x or even 8.2.x. It depends greatly on testing.

It is critical that as many people test the migration path as possible. Especially with sites that have been upgraded previously as those are likely to have the most problematic edge cases.

Currently the migration path in Drupal core is D6→D8, with D7→D8 in progress. The UI needs a patch and/or the "imp sandbox" version of D8. The UI will probably be in place around the time of DrupalCon Austin in June 2014.

Links to the initiative and places you can contribute are listed in the presentation.

PDF icon Slides in PDF format898.47 KB
File Source LibreOffice presentation1013.11 KB

Migrating multilingual data into Drupal 8

First thing, have a D6 site with multilingual things ready to go! This node has a file attached (see end of post) with a copy of D6 with some translated nodes and site information (see settings.php file settings to translate these variables). The file is a drush archive.

D6 "Requirements" at this time:

  • It must have CCK installed (2014-04-11)
  • Recommended to install in the non-English language if you wish to download the translations automatically (this isn't working in the UI yet 2014-04-11). You can also go download the translations manually later.

Setting up D8

Currently we do not work from the main branch as there are significant changes happening in this area of Drupal 8. Some things may be broken. You have been warned! Please test and update issue summaries where appropriate.

  • Clone the IMP migration sandbox and install Drupal 8 https://drupal.org/sandbox/chx/2105305
  • Enable migrate, migrate_drupal, content_translation, configuration_translation, locale/"Interface Translation", language (these last two are installed by default if you did not install in English)
  • Enable English as a language
  • Get the patch so you can bind to a second database in D8 https://drupal.org/node/2181775
  • Create a manifest.yml file in the root

Migration Mappings

Put this file int he root of your D8 site. If you did migrations to D7 with the latest versions of migrate and d2d, this file similar to your migrate.inc file registration array (but in a completely new format).


# nodes
- d6_user_role
#- d6_user (not working yet - "does not meet requirements" 2014-04-11)
- d6_language_types # Patch needed 2014-04-11 https://drupal.org/node/2225293
- d6_language_negotiation # needs above patch
- d6_language # Patches needed 2014-04-11 https://drupal.org/node/2166875 and https://drupal.org/node/2234623

- d6_filter_format

- d6_node_type
- d6_node_settings # gets story content type
- d6_node:*
- d6_node_body_field

- d6_view_modes

You can find the complete list of migrations at core/modules/migrate_drupal/migrate.config.yml and core/modules/migrate_drupal/migrate.content.yml some (like d6_user are not yet working 2014-04-11).

Running the Migration

Then, on the command line, run your manifest file. I used a D6 database with no password because of the bug mentioned above.

drush migrate-manifest mysql://d6@localhost/d6 manifest.yml

You will need the latest Drush if you want support D8! A UI-based workflow is being developed here: https://drupal.org/node/2200379

Rolling Back

This does not exist yet, but if you are familiar with doing this manually in D7 the process is the same:

Use the UI to delete the affected things (in this example, delete your nodes)
Clear the database table that stores the migration info for the specific migration: mysql> delete from migrate_map_d6_node;

Other howtos

Writing D6 to D8 entity migrations - https://groups.drupal.org/node/387488
How to test Drupal 6 to Drupal 8 migrations - https://groups.drupal.org/node/398588
eliza411 - http://dspeak.com/fldc14/dothis.html

More information on Migrate in Core / IMP

You can follow the initiative at groups.drupal.org/imp.

Getting started with multilingual content in Drupal 8

Today I re-installed my copy of Drupal 8 that I use for testing and I must say... wow, there is so much good stuff in here. I resisted upgrading to Drupal 7 with my projects when it first came out and for good reason... many modules that are necessary for my job were not ready when the core module was. I understand this was an improvement over previous upgrades but with Drupal 8 I'm going to be ready to dive in the first day that Drupal 8 is released. This is awesome.

Getting Started Working with Core Dev

First, you're going to need a recent version of PHP. For this reason, I had to use my laptop as a host because my development server uses an older version and I'm not ready to stop production for a beta test. Once you have a suitable environment ready we can proceed with installation.

When the download is complete, visit that site on your webserver. You will now begin the standard Drupal install process. But wait! We have a few extra things to note...

  • I browse in French, so it asked me to install in French!
  • I had to create both files and files/translations in sites/defualt and give them both appropriate permissions (777?)
  • Copy default.settings.php in your sites/default folder to settings.php ... permission it the same way as above
  • Put in your database settings. I picked "minimal" configuration, as I always do.

As I was doing these steps Drupal fetched the French translations for me and did most of the installation in French. Drupal, you are so awesome.

Post-Install Configuration

I do a few things to get setup in my new dev/beta environment because I picked the "minimal" installer.

  • Switch to Bartik theme
  • Enable "color" module and change Bartik's blue to something nicer
  • Enable "toolbar" module so you don't have to click around all over the place
  • Create a "page" content type
  • Enable "field ui" module

Multilingual Config

  • Enable the "content translation" module (the other multilingual modules, "interface translation" and "language" were already enabled for me)
  • Go to Configuration > Regional and Language > Content language settings and enable "content" (thanks Gábor for pointing this out). You can also enable which fields get translated on this page but you may need to enable the content type translation (see next two steps) first.
  • Edit the "page" content type, enable translation on the type
  • Go to "manage fields" for the "page" content type, edit the "body" field, go to the "field settings" tab, enable translation of the field (you must have >1 fields enabled for translation or your page will just redirect to the "manage fields" page
  • Now go edit some content! You will first need to create a node, and then click the translate tab to add a translation
  • You will need a language switcher. I found this hard to figure out at first, but then I realized that most blocks don't exist by default, so if you go to Structure > Add blocks you will be presented with a list of blocks you can create, one of which is a language switcher for content

Now you should be able to create content and switch between the languages. It seems that if a field is blank in one language, it will be sourced from a different language where that content is available.

What Needs Work (Jan 18 2013)

So far I have only noticed a few issues (Jan 18 2013)...

  • The title field is not (yet) translatable
  • If fields aren't translatable on a node type, you get redirected to the "manage fields" page but no message to tell you why you are there
  • Not knowing how to add a language switcher block was a bit confusing
  • The "check for updates now" link is really low profile, I tried to add additional languages but they all have only 7.x branches of the translation files so this link did not work unfortunately
  • The new toolbar does not have icons for the translated versions of the items. Not sure why these little pictures need to be translated/translatable!

Overall these are very minor concerns that anyone who is familiar with Drupal should be able to overcome easily. Especially if you have been doing entity translation in Drupal 7. You'll probably note that the old method of having duplicate nodes of each piece of content, one node per language, is officially gone. This is not a possible way to translate in Drupal 8. Good.

How to Help

Drupal.org is the best place to look for information on how to contribute but I'll try to make a quick summary of the types of places you can contribute.

  • First, look at the issue queue for Drupal 8 issues on the Drupal.org project page for Drupal noted at the start of this article. Read over the issues and comment on them if you can summarize and/or offer feedback on the progress that is being made.
  • Once you are aware of the issues, and you have done some testing on your own, create new issues for items that should be done prior to release. I will be looking at the items I mentioned above as my next steps.
  • Create patches for issues where you are able to fix the code. Since you used git to get the latest version at the start, you can just run git to create your patch: git diff >ddo-issue-number-comment-number.patch ... then take that patch over to the relevant issue and post it to drupal.org!
  • Once you're comfortable with creating patches, you can also test some patches! They are a bit harder to manage sometimes, as you may need to look at the path contained in the patch file. In general, you can probably go to the drupal root and run patch < patchfile.patch. Cross your fingers and hope for no rejects. Then test it and provide feedback on the issue.
  • Join an IRC channel. If you are at a code sprint, this is how we share links during discussion. At other times, IRC is a good substitute when you need to ask a question but you're developing on your own.

Finally, after you've done a few of these things, you're going to come back to the site in a day or two and... throw the whole thing in the garbage. I wish I were joking. Since Drupal 8 is still in development at the time of this writing, major changes can happen that break your config. So often, you will simply want to wipe out your dev site and start over rather than face bugs that are undocumented and temporary. Best to start with the latest, each time you start... unless you're reading every commit message and doing a git diff to see what happened.

Following the Initiatives

There are many "core initiatives" which are focused areas of work on Drupal 8. I have been most involved in Drupal 8 Multilingual... or D8MI. If you search D8MI as a tag on the Drupal project page, you will see what work is to be done. This is possible because the D8MI volunteers have tagged the issues and Gábor Hojtsy, the initiative leader, does an excellent job of keeping us organized.

You can also check out the individual sites for each initiative to see what issues need the most work. Joining the initiative on groups.drupal.org is a good way to stay informed, and each group also hosts IRC meetings on a regular basis.

Drupal 8 Core Initiatives list
Drupal 8 Multilingual homepage (see "focus" page for top priorities)