Migrate to Drupal 8 Using Docker: It Simplifies and Accelerates the Whole Process

A painless, budget-friendly and fast Drupal 7 to Drupal 8 migration process...Is this a joke or what?” you might ask yourself. Not at all: you can always migrate to Drupal 8 using Docker to accelerate the whole process.

Just think about it: you'd have a whole ecosystem of Docker images ready to be moved over to your new Drupal 8 site.

Docker images for Drupal which would automatically:

  • minimize all the issues that occur (and they always do) during migration 
  • streamline the content transfer
  • cut down on the usual costs involved in a Drupal migration process

3 strong reasons why you should at least give this method a chance. Now, allow me to detail:

 

1. A Few Words About Docker 

“Why Docker?” Why use Drupal with... Docker?

2 valid questions, indeed, but before I get into the “Why”, let us focus on the “What”:

What is Docker, after all?

It's a container management software. A lightweight, open source and secure containerization platform used to simplify one's development workflow.

In short: it eases the development, testing and running of one's application or website. 

“And what is a container, more precisely?”

It's an all-in-one, stand-alone, lightweight, executable package that stores everything you might need to run a specific piece of software: library, parts of operating systems, you name it...

“And how is it built?” “How is a Docker container configured in the first place?”

As an answer, here's the “making of a container”:

First, a Docker image gets built from a Dockerfile (some sort of container source code). Then, this file describes how the container should be built (and configured).

Clear enough?

Now, I should also add that there are lots of pre-built containers available out there:

To sum it up, the great thing about a Docker container is that you can:

  • load it with all the settings, dependencies and other software pieces that it needs to run
  • pack it into a Docker image 
  • run it anywhere you need to, irrespective of the used environment

Basically, once you start your Docker image, you instantly run its corresponding container (or instance of that image, if you prefer), as well.

Note: a Docker image can have multiple “satellite” containers.

 

2. Docker Compose: A Quick Overview

Another reason why you should consider this method — migrate to Drupal 8 using Docker — is the Docker Composer itself:

A tool that orchestrates multi-container environments.

Basically, you get to define all the services that you'll need, the resources that they should use, how they'll connect to one another and so on and put all these valuable specifications together in a configuration file.

It's that config file that will include the entire setup, the whole system of features.

And now, here are some more “selling points” of Docker composer:

  • it uses YAML configuration files
  • it makes working with Docker unexpectedly easy
  • it streamlines development environment sharing

     

3. Drupal Development with Docker: All About Using This “Power Duo”

What specific processes of a Drupal development workflow does Docker ease and streamline? Let me point out its main use cases “in collaboration with” Drupal:

  • configuring an infrastructure
  • deploying your new Drupal site's content
  • migrating your Drupal website from its current server to a new one
  • debugging, building and scaling your Drupal site
  • continuous integration
  • putting up a new environment
  • migrating your website to a newer version of Drupal

And here are some of the key benefits of using Docker for Drupal development:

  • Docker containers are conveniently configurable; you can easily build (and rebuild) them, configure them, scale them (both vertically and horizontally) and discard them.

     
  • Docker containers are also ideally lightweight; since they use little of your host machine's resources, you get to pile as many of them as needed

     
  • there are lots of useful Docker images for Drupal available on Docker hub 

     
  • Docker's all about consistency; developers can easily collaborate by switching from one project to another, even if it's different environments that they're using

     
  • Docker containers can be isolated from one another and more often than not each one's “in charge with” one service or process; if there are problems with any of them, the rest remain non-compromised

               

4. Migrate to Drupal 8 Using Docker: Migration Process Overview

Now, time to focus on the very topic of this blog post: migrating your current site's content (media files here included) to Drupal 8 with Docker.

In this respect, here are the key conditions that your migration process should meet:

  • your Drupal 8 and Drupal 7 instances should be placed side by side
  • your Drupal 8 instance should be given access to files directory on your Drupal 7 website
  • Drupal 8 should be enabled to crawl into the Drupal 7 instance; in other words: it should be alive

           
5. What You Can Use Docker for When Migrating to Drupal 8

OK, so we've gone through some of the specific set up requirements to consider once you decide to migrate to Drupal 8 using Docker. 

Now, let's see where precisely, for which parts of the Drupal migration process, you can use Docker:

  • for the development and testing environment
  • for 2 different MySQL containers
  • when configuring volumes so that your Drupal 8 instance can access the Drupal 7 uploads
  • for 2 different Drupal PHP containers (PHP 7 and PHP 5.6) storing PHP, Composer, Apache and Drush 

The END! This is my very brief “pledge” on why (and how) you should migrate to Drupal 8 using Docker. Since containerization stands for a:

  • faster
  • less “painful”
  • safer

development workflow, why shouldn't you use Docker images for Drupal to “turbocharge” your site's migration from Drupal 7 to Drupal 8?