Development

Drupal 8 Migration

October 26, 2016

Jake Litwicki

By Jake Litwicki

Drupal is a free and open-source content-management framework written in PHP and distributed under the GNU General Public License that began in 2001. It has, as of May 2016, evolved into the newly released Drupal 8.1, which, combined with Drupal 6 and 7, powers over 2.2 million websites in the world.

Over the last 6+ years the community, backed by Acquia, “the leading cloud platform for building, delivering, and optimizing digital experiences,” has taken many strides towards improving the flexibility and stability of the platform. With Drupal 6 and Drupal 7, much effort was put into supporting the community of 33,000+ developers who help make Drupal what it is. This included making several improvements to the management of modules and themes, as well as extending and improving (and adding to) the countless APIs available to developers and themes.

This is a sample of the more prevalent issues that plagued earlier releases of Drupal:

  1. PAC (presentation-abstraction-controll[er]) architecture pattern
  2. Lack of mobile-first support
  3. Caching, particularly unwanted cache handling
  4. Test-driven-development (TDD) virtually impossible
  5. Heavy coupling of configuration with database
  6. Performance, particularly memory usage

Drupal has addressed or outright solved many of these problems with the release of 8.0 (and now the public stable release of 8.1.)

Drupal 8 benefits

Drupal 8 Was Completely Redesigned

While the PAC paradigm itself isn’t wrong or inherently problematic, when one of the objectives of your platform is to isolate data, logic, and presentation, the PAC paradigm forces designers and themers to write code instead of focusing exclusively on templates and design.

Leveraging components from Symfony, and elsewhere, Drupal modules are now treated as plugins that are properly namespaced and lazy loaded using dependency injection for dramatic performance improvements, and widespread support of popular libraries and extensions. (You can find official documentation here.)

Drupal 8 and Mobile

The Drupal 8 Mobile Initiative is “a concerted effort to make Drupal 8 a first-class mobile platform.”

Acquia has written a wonderful article outlining a lot of the efforts that went into designing the many improvements centered around mobile support for Drupal 8. To name a few:

  • Mobile First
  • Responsive-ize everything
  • Mobile-friendly toolbar
  • Responsive “preview”
  • Performance tuning/enhancements

Drupal 8 Supports Cache Tagging

Cache tags are built directly into the Drupal 8 core, which allow reverse proxies to leverage metadata to every node on the site and intelligently identify whether or not to expire the page. When combined with Varnish (or a similar service) the performance opportunity becomes an immediate win for bypassing the query heavy page-load time of a “fresh” node.

Test-Driven Development (TDD)

With the decoupling of configuration in the core database, and the implementation of YAML config files, Drupal 8 now supports TDD far greater than any previous versions.

So, How Do I Upgrade or Migrate My Old Drupal Website?

Acquia has sponsored and authored the development of Migrate Upgrade, which is a module focused specifically on upgrading Drupal 6 and Drupal 7 websites to Drupal 8.

Using this tool, and some quick and dirty commands, you can very quickly migrate to Drupal 8 and start leveraging all those new features!

Copy
 drush si standard --db-url=mysql:user:pass@hostname/dbname 
Copy
 drush dl drupal /path/to/html && cd /path/to/html 
Copy
 drush site-install standard --db-url=mysql://user:password@hostname/db 
Copy
 drush dl migrate_upgrade features -y 
Copy
 drush en migrate_upgrade features -y 
Copy
 drush migrate-upgrade --legacy-db-url=mysql::user:password@hostname/db --legacy-root=http://mysite.dev --legacy-db-prefix=drupal6_ 

 

Keep in mind that there are still a few drawbacks, so it’s not entirely done at this point:

  • entityreference, user_reference and node_reference will not have migrated
    • Also a timesaver: The bundle column in field tables will correspond to the node type in D8, rather than simply node
  • User profile images will more than likely be null and require a re-upload depending on how your previous public/private file system was set up in Drupal 6
  • Views will not be migrated as they’ve been restructured and worked directly into Drupal core

Eventually, Drush will support all this functionality, which will make this module obsolete; in the meantime, it’s a very handy middleware tool that greatly helps the migration of standard Drupal websites.

Need help migrating or upgrading your modules to Drupal 8? We have experts. Contact us to learn more.

Jake Litwicki

Jake Litwicki

Software Development Director

Unless otherwise specified, source code in this post is licensed under a
Creative Commons Attribution 4.0 International license (CC BY 4.0).

You might also like...

28

Nov.

Will Lingard

VR Developer’s Journal Part 2: Content for VR Games & Experiences

The second stage of my VR Developer’s journey began in 2016, when Vive launched with a bit of a problem. Well actually, more that something was missing: content to play. The VR ecosystem in general at this time lacked software games and experiences that a user would love to install and play on their shiny new VR … Continued

21

Aug.

Will Lingard

VR Developer’s Journal Part 1: Getting into VR

This is the first in a new series of Fresh blog posts about Virtual Reality (VR). Eventually we’ll be diving into the more technical aspects of software development for VR; however, this first blog post is more of an introduction, to give you some background and better context to what follows. It’s important to note … Continued

26

Jun.

Travis Luong

How to Debug Django Apps

How to Debug Django Apps In the JavaScript world, my primary debugging workflow consists of dropping a debugger or a console.log into the code and seeing what happens in the browser’s developer console. This methodology has always worked effectively for me. However, I have started to work more with Python and Django recently, and though … Continued