Skip to main content

My first livestream, and upgrading to Drupal 9

Published on Monday 22, June 2020

On Sunday I did my first live stream where I upgraded my personal site to Drupal 9. It was a fun experience and I learned a few things – both for streaming and upgrading.

I managed to deploy a broken version of my site because I blindly trusted Composer metadata would prevent incompatible modules from allowing Drupal 9 to install. I was wrong. I forgot to use the Upgrade Status module to check if all of my contrib modules were compatible. I forgot to test the deploy and upgrade locally. 🤦‍♂️ Oops. Everything is fine, now. I had to make a fork of Disqus and Media Entity Browser.

Upgrading to Drupal 9

The biggest blocker I had was drupal/console. Drupal Console is not compatible with Drupal 9, and you must remove it when trying to upgrade. You also need Drush 10, but that's an easy change to make.

In the end, this was my Composer command to update to Drupal 9 (including two modules which conflicted with version constraints, and I have fabpot/goutte as a direct dependency for some integrations.)

composer update drupal/core-composer-scaffold \
	drupal/core-recommended \
	drupal/core-dev-pinned \
	drush/drush \
	composer/installers \
	fabpot/goutte \
	drupal/swiftmailer \
	drupal/honeypot \
	--with-dependencies

Unfortunately, I deployed this and the CodeSnippet CKEditor plugin module crashed my site, as it tried to use the removed EntityManager service. I don't know why Composer allowed Drupal 9 to install if the module itself is incompatible with Drupal 9. Luckily I was able to use the development release to fix the problem (and open an issue requested a release.)

I was not as lucky for the Disqus module and Media Entity Browser. I forked those to GitHub and applied the Drupal 9 fixes for a temporary workaround. I have the following in my Composer manifest:

    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "1": {
            "type": "composer",
            "url": "https://asset-packagist.org"
        },
        "2": {
            "type": "vcs",
            "url": "[email protected]:mglaman/drupal-module-disqus.git"
        },
        "3": {
            "type": "vcs",
            "url": "[email protected]:mglaman/drupal-module-media_entity_browser.git"
        }
    },

I then pointed the packages to the 2.x branch I created in each.

        "drupal/disqus": "2.x-dev",
        "drupal/media_entity_browser": "2.x-dev",

You can catch the recording over on YouTube, or embedded here!

Thanks to Miro Michalicka, I can provide a link to the Drupal.org Composer facade bug that allowed updating incompatible modules to Drupal 9: https://www.drupal.org/project/project_composer/issues/3152701.

Lessons learned when streaming

This was my first time doing a live stream. It was even the first screencast in a few years. I definitely walked away with some things to work on.

Better kickoff

I started the stream about 10 minutes early to open the "lobby" and send pings to anyone that set up a notification. 10 minutes is longer than you think. I also didn't realize how long it would take to be able to edit the video via the YouTube Studio editor to trim off that dead time. So maybe next time I'll just give it a minute.

OBS scenes are cool, if you remember to use them

I used the Open Broadcast Software (OBS) tool as my encoder to stream to YouTube. OBS allows you to configure different scenes. Each scene allows you to have different input sources. I set up four:

  1. "Starting soon" entry scene – backdrop with no video or audio.
  2. Self – webcam and audio only
  3. Desktop – webcam, audio, desktop view, and mirror of the YouTube chat
  4. Closing scene – backdrop, no video or audio.

I kicked off the stream with my entry scene and went to the Self scene to do my introduction... and then I forgot to switch to my Desktop scene. Thankfully it was brought to my attention via the chat.

Stream delays

There was a 20 second to 30 second delay from what I recorded to what was showing up on YouTube. I didn't account for that lag when preparing myself. My connection to YouTube was "Excellent", but I don't know if I configured something to increase the delay or not.

Microphone in mono

When listening with a headset, folks said my microphone was in mono and not stereo. I checked my OBS settings after and have no idea why that is happening. I'm still figuring out my new microphone and the audio interface. So I want to figure that out.