Upgrade Drupal 8 to 9 in five steps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi today we're going to talk about upgrading from drupal 8 to drupal 9. how simple it is and how it could be done in just five simple steps but first let's talk about the upgrade process itself now um unlike every other previous version of drupal drupal 8 has done some things very differently and moving forward going from 8 to 9 from 9 to 10 is going to be different than anything that's happened before and in fact it's something that dries has said that really the big deal about drupal 9 is that it's not really a big deal in fact going from drupal 8 to drupal 9 is really no different than doing a a a minor release of drupal 8 itself now with just a few simple exceptions so when we talk about going from upgrading drupal in any previous version there was always a complete shift because we were not able to not unafraid to break backwards compatibility in order to make drupal better and better however we've reached a place with drupal 8 that we're able to do some things with technology with the way we structure it that we no longer have to do this and so we don't have to do a complete and total rebuild to go from a major version to a major version which is what we're seeing now from eight to nine and the reason we can do this is because of the way that we're handling deprecations now if you look at something like the drupal 8.7 api this is the structure for how the code works for the internal calls that it makes and you can see that we in 8.7 we added some new features some new solution and we deprecated something else now what it means when we deprecated something in the code there's an object or a function or a method or there's some part of the code where we've said okay this is still works today but in the future we're actually going to get rid of this piece and we're going to replace it with something else now when we start going and talking about later versions of drupal like 8.9 you can see that not only have we added additional new solutions we may have other bits of deprecated code that code still works everything is fine but in the future it's going away and there's going to be a different way to solve that problem you'll also notice here that we're built drupal's built based on symphony 3 as part of drupal 8. now when we start talking about drupal 9 the only there are just a few minor differences we still have any of the new solutions any of the standard tools and code that we want but you'll notice that that deprecated code has been removed we've taken that out and now you have to use whatever the new way of solving that problem is so instead of using the drupal set message function you actually call a service to get your messages out to the logger the other big thing that this allows us to do is to make some large changes to some some of the foundational pieces so you'll see here symphony 3 is going to be end of life and so drupal 9 is based on symphony 4.4 and this process is what allows us to seamlessly move from one to the other the big trick of course is we have to be mindful of that deprecated code so what that means is that drupal 8.9 and drupal 9.0 are almost identical the difference is that any deprecated functions have been removed and third-party dependencies may have been updated but otherwise this means that any drupal 8 modules that are not using deprecated code will continue to work on drupal 9 just fine so we don't have to rebuild your entire site your application you don't have to rebuild your modules you just have to make sure that those modules are going to work in this new environment and we'll take a look at that now this whole new process is is pretty incredible and it's enabling us to do things as a community much much faster than we've ever done anything before because there's less work right we can use almost all of the same code we just have to make a few changes i'm going to show you a few slides that came from the dries notes at drupalcon in the the spring of 2021 these numbers are actually much much better today but we know that when drupal 9 launched most of the contrib modules that the people wanted were um at least available and 10 months after drupal 9's release uh 90 of the top 50 modules were ready in fact we can see at that same time period we actually had a huge number um 67 of the top 1000 and some of those um actually some of those the fixes were actually going to be even simpler and they just hadn't been implemented yet and we've got a tool that helps us do that so so we know that going from drupal 8 to drupal 9 is not that big a deal it's going to be pretty easy for us we know that there's several steps involved let's talk about what those steps are because once you understand those five steps it doesn't matter how big your drupal 8 site is you'll still follow those same basic steps in order to do the migration whether it's a very large application or it's a small one so these are those five steps number one ensure that you have a drupal 9 compatible environment for your new um for the site that you're upgrading number two make sure the drupal 8 core is up to date ideally you have all of your updates for all of your code things with the latest versions that's going to make your life easier same thing with your contrib projects make sure you've got those updated in fact if you do that some of your contributor projects maybe all of them will already be ready for drupal 9. so you'll you'll be kind of a one step ahead there search through and your custom code and look for any places you're using deprecated code we actually have some tools that will help do this for you so we'll identify where you're using deprecated code or where you should make changes to things so that part is actually again pretty simple once you've removed all of your deprecated code you've got your core and contrib up to date you're using the latest versions for everything all you have to do then is upgrade core itself to drupal 9 and you should be good to go now one thing that you'll notice is that several of these steps are powered or enhanced by using composer and composer is a big um it's a package management tool it's a big part of using drupal 8 and beyond so let's take a minute and talk about who composer is in case you may not be familiar so uh what is composer well composer is a a package and dependency management tool for php what that means is that i can go into my php application in this case drupal and i can say i need to add this new module this new feature and maybe that module depends on some other code and maybe that code depends on some other code and maybe that code depends on some other code well now i don't have to worry about that whole long dependency chain and figuring out what i need to use composer manages and tracks all of that for me which makes my life much much easier and this is also why we're able to use non-drupal php code in our tools and our systems because we can pull in those dependencies and libraries and make them available in the system even if they weren't originally built for drupal and we also have code that was built for drupal but because it was built in this way other systems can use it with composer as well so it's a great way for us to kind of get off the island now this isn't something that's new this has been around for a long time and in fact most languages and frameworks out there have some type of dependency management and package management tool that's available for composer for php it's it's composer so let's take a look and see what's actually happening here and we've we've got this little life cycle we're going to go through these images are actually coming from composer the right way by raphael doms but you can see we start with our composer.json file and that composer.json file is really just a list of a list of the the packages or the components that you want whether they're drupal modules or php libraries it's got some information in there about configuration or if you want to make patches don't worry too much about that just know that you're managing all of your projects here and this this happens in a cycle so you have your composer.json when you run composer it's going to make a call out to packageist packageist is a listing service that allows you to figure out okay i need this particular module what is it what versions are available where does it live the packageist is going to then direct composer to know where the original source of that component or library is and then composer is going to actually take that and pull it into the vendor folder in your code base and so now we're going to have that external package has going to be pulled in to our code base automatically and then composer's going to create a composer.lockfile that's going to put list out the specifics of exactly what was built and exactly what's in here for future use so let's see what happens if we look a little bit more closely on that so let's go in and say that we're going to be upgrading to drupal core and so we say i want uh we require in our composer drupal core 9.1.0 or greater that's what the little up carrot means packages says okay great well um we actually have 9.1.7 and it matches your requirements it is greater than 9.1. oh it's the the latest version it's got a ga release take it so that goes to the source that gets pulled into our installation and then you can see our composer.lux says hey we're actually using drupalcore version 9.1.7 now in our composer.json file we just gave it a rough parameter we said we want something that's higher than this the composer.lockfile which is generated by composer are the specific and exact version numbers that we have now we did put together a workshop that we delivered as part of the extended drupal days after drupalcon 2021 if you see here you can actually go to github and check out this workshop what this does is it provides you with the sample code base that's already got some some basic stuff in there and some steps the directions there are designed to work with cloud ide which is part of the aqua platform but of course you don't have to have that it just makes it faster and easier for you the interesting thing about this workshop is that you can if you follow the directions you can go all the way from doing a basic drupal 8 all the way to upgrading it to a drupal 9 following all five of those steps and you can do it in about 15 to 20 minutes maybe 30 minutes so it's a great way to kind of get your hands on it and see how it works so definitely recommend checking it out so to recap there are five steps that you need to follow to upgrade from drupal 8 to drupal 9. number one make sure that you are in a drupal 9 compatible environment with the right versions of php make sure the memory and the code base set up the way you need it number two make sure you have drupal 8 core up to date to the latest version number three make sure to update all of your contributor projects to their latest versions you should get a lot of your d9 upgrades taken care of that way number four make sure and remove all of the deprecated apis and function calls in your custom code if you look in that workshop we do talk you through how to use the upgrade status module to help you manage that and it'll tell you exactly what you need to change that's pretty straightforward process and then once you've done all of that your code base should be d9 ready and you'll be able to upgrade core to drupal 9 itself finally if you haven't done too much with composer composer is going to be your friend is going to help you out feel free to go back and look at the parts about composer again get in there and learn some of the basics and again if you take a look at that workshop it'll provide you with all the directions for doing the basics we should provide you everything you need so just remember the great thing about drupal 8 is that going from 8 to 9 it's actually not a huge feat it's pretty straightforward we've got a lot of resources here to make it easy for you and um go give it a shot
Info
Channel: Acquia
Views: 56
Rating: 5 out of 5
Keywords:
Id: Ojj_yC14grY
Channel Id: undefined
Length: 13min 10sec (790 seconds)
Published: Thu Sep 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.