This website is currently (as of February 2020) running on Drupal 7. Drupal 8 was released in November 2015—half a decade ago. Drupal 7 support has been extremely long-lived, as it will not be end-of-life'd until November 2021. As with all software, once it is out of date, and security patches are no longer provided, it becomes harder to ensure the software is secure, much less running well on the latest servers and PHP versions!
Therefore, I decided it was time to start migrating JeffGeerling.com to Drupal 8. And I figured instead of fumbling through the process all by myself, and maybe posting a couple blog posts about the process at the end, I'd adopt a new mantra: Let's fail together! (Just kidding—sorta.)
So for this migration, I'm going to be live-streaming the entire process, end-to-end! Every Tuesday (starting today, February 4, 2020), at 10 a.m. US Central time (4 p.m. UTC), I will be live streaming part of the migration process for one hour. The videos will all be visible after the fact on my YouTube account.
There are a few caveats to get out of the way going into this project:
- This is the first time doing any Drupal 8 migration work since Drupal 8.2, in 2016. A lot has changed in Drupal 8 since then, so I'll be learning some of this as I go—I figure some people might enjoy seeing how I learn new processes and techniques (hint: lots of Google).
- This is the first Drupal 8 work I've worked on since upgrading the theme of the Raspberry Pi Dramble website in late 2018, so my Drupal 8 is a little rusty as well.
- This is the first time I've ever tried live-streaming, and I'm doing it on a four year old 13" MacBook Pro; the CPU might not be up to the task at times, but we'll see how it holds up!
If you want to follow along as it happens, please subscribe to my YouTube channel and sign up for notifications—that way YouTube can notify you when a live stream is about to begin (I will try to remember to have them pre-scheduled every Tuesday). Otherwise, I will also be embedding all the live streams after the fact on this blog post (so check back again later to see them if you miss a week!).
Supporting this project
I'm not being paid or sponsored for any of the work involved in producing these videos; if you like them, and have the ability, please consider sponsoring my work on one of the following platforms:
If I get enough, maybe I can afford a faster computer and stream with a better frame rate :-)
Episode 1 - Setting up a new Drupal project, installing Drupal the first time
Streamed on: February 4, 2020
Summary: I created a new GitHub repository called
jeffgeerling-com, then I created a new Drupal 8 codebase. I added a
.gitignore file since Drupal's composer template doesn't currently ship with one, and made sure to not add the
vendor directory or other Composer-managed files to the Git codebase. I committed all the code, and pushed it to the master branch of the
jeffgeerling-com repository on GitHub. Then I created a simple Docker image for local development, brought up a local environment using Docker Compose (with a Drupal/Apache/PHP container and a MySQL container), and finally installed Drupal using
drush site:install. I logged in and verified the site is working correctly (if a bit sparse—I installed the minimal profile!).
- drupal-for-kubernetes Drupal project setup guide.
- Using drupal/recommended-project to create a Drupal codebase
- Arch Linux memes
Episode 2 - Getting the Configuration and Content Migration Ready
Streamed on: February 11, 2020
Summary: I downloaded the Upgrade Status module and went through which modules did or did not have upgrade paths for Drupal 8. I found that most modules I use are now in Drupal core, and most of the contributed modules I use have a stable Drupal 8 version available. There are a couple modules that might need some special tweaks to make sure I don't lose data—like making sure Redirects are migrated correctly from Drupal 7 to Drupal 8—but most things should just work in Drupal 8 without much effort. I then read through the Upgrading from Drupal 6 or 7 to Drupal 8 documentation guide, and chose to use Drush for the migration. So I installed the appropriate modules, and tried connecting my site to the legacy Drupal 7 database by adding a database to the
$databases array in the Drupal 8 site's
settings.php file. Unfortunately, I was unable to get the Drupal 8 site to see the Drupal 7 database before the episode's time ran out, so we'll get that working in the next episode, and run the
drush migrate-upgrade command for the first time!
- Drupal Upgrade Status module
- Upgrading from Drupal 6 or 7 to Drupal 8
- Migration modules for Drush-based migration: Migrate Upgrade, Migrate Plus, Migrate Tools.
Episode 3 - Fixing bugs, exporting configuration, and running the first migrations
Streamed on: February 18, 2020
Summary: After figuring out we had to use
docker.for.mac.localhost as the hostname to connect our new Drupal 8 site to the old Drupal 7 site's MySQL database, we were able to run the
drush migrate-upgrade command! But then it failed, because Drush 10 is currently incompatible with
migrate-upgrade. So we downgraded to Drush 9, then got
migrate-upgrade to work! Once it was done, we were able to see all the available Drupal 7 to 8 migrations, and run them, but we ran into a few errors. We used these instructions to export the site's configuration to the codebase, and pushed the changes to the site's git repository. Then we reinstalled the site from scratch, to prove the configuration export and import worked well, and ran the migrations again, running into a new error, "Field discovery failed for Drupal core version 7," which we'll debug on next week's episode!
Episode 4 - Setting up CI with GitHub Actions and Overcoming Field Migration Issues
Streamed on: February 25, 2020
Summary: We started off by setting up GitHub Actions for some basic Continuous Integration (CI) tests for Drupal, but quickly ran into a wall as GitHub experienced an outage and the Issue queue and Actions stopped working. So we switched back over to the migrations and found that all the issues like
Attempt to create a field storage field_project_images with no type. meant that a field-related module was not enabled in Drupal 8. So we enabled the right modules (e.g. Date, Link, Taxonomy, Comment, Options, etc.), and ran the
migrate-upgrade command again... which started generating duplicate migration entities, named like
upgrade_upgrade_upgrade_d7_thing.yml. So to prevent confusion, I deleted all migration configuration, reinstalled the site, re-exported the configuration, then ran
migrate-upgrade yet again. It now created the migration entities with a single
upgrade_ prefix, which is much nicer to manage. I kicked off the migrations, and it got further along, and started migrating images (which took some time, as it had to download each image, save it to the Docker shared filesystem (which is slow) and create the file entity in the database (which is slow). So we cut off the episode there and will get back into running the migration again next week!
Episode 5 - TBD
Streaming on: March 3, 2020