Drupal 8.1 Migration - Not Quite There Yet

Submitted by Kevin on Fri, 04/29/2016 - 17:41

With the announcement that the Migrate modules were being included in Drupal 8.1 (albeit as experimental modules), I thought it would be worth giving them a try against a moderately small site just to see how well they work.

First of all, Migration is going to be a very different process from anything you may have done in the past to go between Drupal major versions.  It's very important to read the basic instructions, which I'll summarize here:

  1. You will not be applying Drupal 8 to a copy of your current Drupal 7 or 6 site as you could do with upgrades to Drupal 7 or 6.  Instead, you need to create a fresh new installation of Drupal 8, preferably on the same server that houses your existing Drupal 7 or 6 site.  For safety and speed, the best option is to clone your existing site to a development server, and then set up your fresh copy of Drupal 8 on that same server.  It's also very helpful to set up your filesystem permissions so that your copy of Drupal 8 can fully access the back-end files of your Drupal 7 or 6 installation.
  2. After you have Drupal 8 installed, don't configure anything, as you need to do your migration first.  Go to the Extend administration control panel and enable the three Migration modules [found in a CORE (EXPERIMENTAL) section below the regular CORE section].
  3. Next, install and enable any contrib modules that you used on your Drupal 7 or 6 site that have Drupal 8 equivalents and have associated data and/or settings that you want to try to import.  If a module doesn't have data or doesn't have settings that can't be easily reconfigured on your Drupal 8 site, don't worry about it right now.  The less to deal with at this point, the better.
  4. Make sure you have the username and password for a database user that can access the database of your Drupal 7 or 6 site (again, this should be a copy on the same development server where you have installed Drupal 8).
  5. Navigate to /upgrade on your new Drupal 8 site and follow the prompts.  Enter the database account information requested for accessing your Drupal 7 site, and enter a full server filesystem path to the filesystem of your Drupal 7 or 6 site.  This should be the main top-level directory, where you find the index.php file.  If you have trouble with this, you can also provide the URL to the main page of a live copy of your Drupal 7 or 6 site, and Drupal 8 can pull down any needed files that way, but that's likely going to be slower.
  6. After submitting your settings, Drupal should give you an analysis of what it can migrate.  Don't expect to see a perfect match-up for everything, as you'll likely have some Drupal 7 or 6 modules that don't have Drupal 8 equivalents, or don't have direct upgrade paths to Drupal 8.  Some modules may have changed names in Drupal 8 as well, so don't let that throw you.
  7. If you feel comfortable with what Drupal is proposing to do, select the button to proceed and then sit back and wait.  Depending on the amount of content you have in your existing site, it may take an hour or more for the migration to complete.  For a small site, though (around a couple dozen pages), the process should take less than a minute most likely.
  8. Return to the main page of your Drupal 8 site and start looking around to see what the damage is -- there's likely going to be stuff that doesn't migrate over cleanly.

In my test, I migrated a site with about a dozen regular pages, a handful of blog pages, and a couple dozen book pages.  All of the content came over just fine as far as I could tell, but I don't think I had any attachments (files, images, etc.) anywhere, so it wasn't a good test of Migrate's capabilities for file content.  However, I did run into problems with both blogs and books:

  • Books are not fully supported for migration yet.  The individual pages come over, but not the structure, so it's not a good idea to migrate a site using Books right now unless you don't mind putting all of the pages back into the right ordering.
  • Blogs are no longer part of core.  There's a development contrib module to supposedly replicate that functionality, but I thought it would make more sense to just display my blog entries list via a view, since Views are now part of core.  I got that working finally, but do see my notes below about text formats.  In short, you can pretty easily replicate the blog concept with a fairly straightforward View configuration, but you may need to go through and add structured URL paths to each blog post if you really want navigation to work nicely (Drupal 8 builds breadcrumbs based on the URL paths now, so structure of your URL paths is a lot more important than it used to be.)
  • Migrate is missing a component to migrate text formats, which is going to affect a lot of us at Tech due to the custom formats defined by the GT Editor module or other similar WYSIWYG implementations on campus Drupal sites.  Fortunately, there seems to be a relatively quick fix: 
    • Simply check for any missing text formats and create them on your Drupal 8 site with the exact same name.  Upper/lower case is not important, but the spelling and spaces are important, because you're wanting Drupal to create the text format with the same machine name as was in use on your Drupal 7 or 6 site.
    • If you don't create these missing text formats, you'll find warnings and errors being thrown, most notably if you try to create a view to display some of your content.  Something in the Views code throws a fatal filter related error if it can't find the matching text format for each content node, which results in most of the content being displayed to the screen but without being wrapped by your site's theming structures.  What's confusing is that it only takes one node using a non-existant text format to trigger this error, but finding that one node could take a while, especially if you don't know what you're looking for at the time.

For the most part, having solved the Blog issue, my site would be mostly usable once I port two small custom modules over, which shouldn't be problematic in theory.  The only contrib component of this site that doesn't exist for Drupal 8 yet is Webform, which is currently being ported, but may take a while.  The current suggested workaround is the Drupal 8 built-in Contact forms plus Contact Storage (still in beta as a contrib module, but planned to be moved into core in a future point release.)  I haven't played with this yet, but it seems likely it would work for the simple "contact us" web form that I would need to migrate over for my site to be fully functional.

Overall, it still feels a bit early to migrate anything more than a really simple site into Drupal 8, but there might be some hope for migrations of complex sites to be feasible perhaps when 8.2 comes out this fall.