Drupal 7 to 8 LIVE Migration - Ep 3 - Migrating with Drush, exporting configuration to code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Episode 3 is today! Last week we got the Migrate modules set up, then had issues connecting to the old database from the new site. This week, we'll overcome those database connection issues, and see if the Migrate modules and Drush can work to get the initial migration work done!

Edit: Added to the blog post with all the episodes, https://www.jeffgeerling.com/blog/2020/migrating-jeffgeerlingcom-drupal-7-drupal-8-how-video-series

👍︎︎ 8 👤︎︎ u/geerlingguy 📅︎︎ Feb 18 2020 🗫︎ replies
Captions
alright it looks like it should be live now I just counted as out it looks like there's about a 17 second delay on this stream so if you chat me something and they don't respond right away that is why I'll put in here also welcome to episode let's get started alright so welcome this is the third episode my iPads volume was up and when it when the stream kicked in it started playing it had so anyway this is episode three of who knows how many episodes this will be an ongoing series migrating my website which is Jeff Garlin comm from Drupal 7 to Drupal 8 the first episode we set up the code base we set up the site locally and it ended up looking like this the second episode we set up the migrant modules tried to get connected the data to the database my old database and ended up at that point having the database not being able to be connected to so in this episode we're going to try to connect that old database the Drupal 7 database that's running locally and see what we can do getting getting crushed to to kick off the migration and set up the migration configuration for us so I set up this issue last week figure out why the connection was not working and I actually cheated a tiny bit I spent a few minutes looking into what the problem was and what happened what happened was we went we ran the drush come in for the migration so I'm gonna open up a new terminal window and I will say docker PS to see what's running Jeff Keeling Netcom so I'm gonna log into this container the Jeff Skilling - comm container so I'm gonna save docker exec - so that gets me into the docker container and I can run drush commands and/or Bend rush status this check and see if drush is working okay and I might be switching development environments depending on how today goes we might spend a little time switching over to Dee dev or something like that to see if we can get a little more speed my poor laptop is practically dying doing this live stream the CPU is already at like 90 percent and continuously while I'm streaming and then throw in brush and my sequel and things like that and it just is not a very happy scenario then the stream might drop out a couple times so we'll see what happens but anyway so josh is working and I tried running this my great upgrade command sorry about my throat it seems like I might have a little bit of dryness whoops let's go back here so I tried running this command and it gave me an error trying to connect to the database so this is the connection string for the old legacy Drupal 7 database and it gets that connection string from here so when you say legacy DB key for the my great upgrade command that is this key this array key right here let me get a drink of water I'm also gonna ask if anybody on chat can just say if you're seeing this okay make sure that it's not too small or anything actually I might the code might actually be under the window let me check how that looks yeah let me you bring this code over oops let me bring the code over so you can actually see it so the problem was it's trying to connect to localhost and the way I have this set up I'll make a new window docker PS there's a there are two containers running the new site there's Jeff killing comm is the Drupal Apache and PHP container and then there's a my sequel container running the database the old site is running on at docker container and so if we try connecting to localhost that doesn't work even though if I open up sequel Pro on my Mac that's the application I usually use to connect to databases to my sequel and marija DB databases if I connect here I can connect to localhost or 127 dot 0 dot 0 dot 1 and that's on port 3306 yeah so I can connect to it here so that's the old database and I can also connect to the new data that are the the old database sorry I can also connect to the old database on port 3307 that's all from my local host the problem is if you're inside the stalker container if I try running my sequel - you Drupal - P Drupal is the password - H Drupal or H would be 127 dot 0 dot 0 dot 1 and database is Drupal and if I try doing that it's gonna say can't connect because inside the docker container 127 that 0 dot 0 dot 1 is that docker container and it's not seeing my host machine so I also tried doing things like putting in the what is it docker PS I tried putting in this Drupal 7 name for the container Drupal 7 that didn't work I tried putting in my host IP address all kinds of different things none of that worked so I found out after a little bit of digging that there's a special a special DNS name that looks up the host machine and so you can bounce through that to other containers on your running on localhost to report so I tried this and this actually works because it goes through that special connection and let me make sure that someone yeah working well good so this kind of bounces through localhost through through docker for Mac local host a special DNS thing that's this only works on docker for Mac for docker for Windows there might be a different one and for Linux I think that it works a little more easily in general so you don't have to have a special bounce through localhost thing so if I do this this actually works and I'm connected show tables and it shows me everything so I can connect to the database so that's that was the problem there so now if I come over here and I put in that that name for the host instead of localhost this should work so I'll save that file and I'm gonna go up to this command again same command and run it and we'll see what happens okay so now we're getting an error message and this is another thing that happens sometimes when you're doing Drupal work with things that are still kind of sort of in flight the migration process is mostly done but there's still a few little things odds and ends that are being cleaned up apparently the migration modules called rush print which was deprecated and rushed ten I know that because I searched it what I did to figure this out was I just grabbed this call to undefined function and rush print I went in over to my handy debugging tool called Google and I searched that and migrated and then I found this issue with the migrated upgrade module and in this issue basically it says yeah there's a problem with that I went over here and it has a patch I think this model or this issue does patches needs work it looks like there's some still some failing tests but the idea is that this module needs to be upgraded to work with drush ten and I also when I whenever I run into these issues I always put a comment saying like here's how I found this and here's some ideas for making this easier because what what happened was I I read through the and you can look back in the video from last week I was reading through this this documentation and said installed rush and so you just run this and you installed rush the problem is that gives you'd rush ten and rush ten gives you this error and then you get stopped and blocked and you can't do a migration and that's really annoying so in the issue I commented hey that this you know this error message is annoying maybe we should recommend that you used rush nine and so I think was it here Reza Thank You Reza put in a comment in in this documentation that says for now used rush nine there's there's a patch in this issue and there's two different ways we could approach getting over this problem one way is we could take this patch and apply it to our project and work with that the other way is to install drush 9 and for now I'm just gonna use Josh 9 to get past this but in the future I'm we might need a patch for something else anyways and if we do then I would show you what I do for patches there's there's a utility called I don't think it's added to the Drupal core Composer project template but there's a project called what is it composer patches that lets you apply patches and manage them using composer in the old days what you would do is you'd like download a patch file and put it in a patches folder and apply it to your codebase and that it be tracked that way but it's very manual and what would happen a lot of times and I've seen this happen many times as you would upgrade your site and you'd forget to reapply that patch and you'd go to production and then things start failing because the patch that you rely on is gone so this this project makes it so that every time you run composer install it makes sure that patch is always applied and if there's errors with the patch like if you update to a new version of Drupal core and the patch breaks you'll know that right away instead of going to production and seeing that it breaks so in the future we might do that for now just know that there's a school composer patches utility and it's relatively easy to set up and all you have to do once you have it running is add a line for each patch you do so if I wanted this patch I would copy the URL and I would put it into a composer patches section my composer to that JSON file and then run composer install but we're not going to do that instead I am going to go back over here to my code base and close out of here I'm gonna go here and say composer require what was the command brush brush nine dotto paste it in composer required rushed rushed nine nine that oh this is going to say give me any version of nine the latest version of nine but not any version ten or after that's what these these little things this is meaning like 9 and above up to 10 there's a bunch of these different modifiers and the composer's documentation goes through them all there's like Tildy and there's a little caret and there's I don't remember what other ones there are but each one of them means something different in terms of the version constraints so this is going to update well it's going to downgrade drush - 9 - 9 . something 9.7 i guess instead of running drush 10 and we'll see that change in composer at json so you can see it already updated here when i ran this command and soon it's going to update the composer dot lock file to choose the right version address and all the dependencies under it so let that go for a minute and hopefully once that's done this command when you run it again I just pressed up to get back to this command actually I'll go clear hopefully this command will will run and not fail once this is done no so now we're hitting this Arian what is the composure I keep hitting this with my Drupal projects now and I probably should just set this globally composer memory limit forget what the thing is that we need to put here composer memory limit equals minus one so that's saying don't have a memory limit for composer itself and we'll try that again just by quitting Hill anything that is not completely devoted to this live stream needs to be quit otherwise this computer falls over I guess now would be a good time to say if you want to continue watching these videos the best way to make sure that you're notified of them is right below where I am on this just below me there's a subscribe button if you hit that and also that little notification thing I don't usually use notifications because I don't like notifications but if you want to be reminded of when there's a new one of these coming out which is every Tuesday at this point subscribe and hit that notification button and then that way when the stream starts you should get a notification on your mobile device or email or something like that maybe you get a carrier pigeon like I said I don't actually use the notification so I don't know how YouTube does it but I know that all the other youtubers i watch they always are hyping up the subscribe button so I figure I'm supposed to do that too should probably also be a little more crazy in wild because that's what they do and I'm supposed to cut all my things so you don't ever hear me breathing cuz apparently that's how you talk if you're on YouTube anyway looks like this finished I'm gonna say git diff and see what changed so it says drush instead of 10.2 it's 9 dead oh and then yeah so dress 972 and then all the rest of the dependencies in this file are there so I'm going to add that so it just has those changes and then a couple there's a little new section in the readme that I started working on right here oops so I'm gonna say git commit dash M downgraded drush 29.7 dot X because it was causing problems eric says Mac - - that's an inside joke but yeah I believe me I have considered looking into using a PC with like 64 gigs of RAM and some sort of thread Ripper processor for this stuff the other nice thing is so this the software I'm using for the live stream is called OBS it's an open source streaming program and you can set tons of different options and I have basically everything on minimum that's how I've always played games too mostly because I never had a computer fast enough to play them even though I have a PC but it's a slower PC it's not like a gaming rig but if you get a PC running Windows with a certain supported video cards OBS will use them for the encoding so your CPUs not doing all the extra work anyway that's that's another topic for another day but I committed this and I'll push it up to my code repo and I probably should have put in here an issue reference actually that let me do that really quick I'll just show you because get is something that over time as you as you work with version control especially if you're on a team more it's good to know how to do some things so get commit - - amend lets me change my get commit message and this drop me into vim you can configure get to use Nano or some other editor if you want but I'm using vim so I'm gonna hit I to go to insert mode and put in an issue reference this is issue number five or five and then hit escape and then go on write and quit and now if I say get push it's gonna say it's rejected because I changed something and get and get you shouldn't change history shouldn't change commits that already pushed up to a github repo and things like that but since this repository is private and then I'm the only one that can see it I will do a force push and as they say use the force get pushed - force you should almost never do a get push but push force in any circumstance however in this case I know that the only change was I change this commit message so and I'm the only one using the repository so it's not going to cause problems for me so anyway I did that and the nice thing with github and I think get lab 2 is if you mention an issue it pops it into the issue a link to that commit so I can see right after that oh here's what I did to fix that so just a little aside once you get get more aggressive with using git and use github or get lab or some of utilities like that it's nice and stream labs I'll have to check it out at some point that's somebody called - all right so we have draw let's try this command again now that we have a version of drush that supposedly works with my great upgrade module let's see if the cpu can take it no that's annoying so here's a new problem and I wonder if it's just russia's cache needs to be rebuilt if you ever downgrade rush or install new modules things like that sometimes you just need to do it cache rebuild so I'm gonna try that and see what happens so far the computer hasn't died so that's good thing okay so it did a cache rebuild let's try this command again clear we're at that history and let's see if it blows up or if it actually works hey it's doing something somethings better than nothing and it looks like there were no errors if you're ever in a terminal and you want to see if there were errors if there's a lot of output you can what is it do this dollar sign question mark that means that there were no errors if it has an error to give a 1 or the error code 1 or anything above 1 would be an error anyway so there's no errors and at this point that was just the config I think I did configure only so that should have exported the configuration that means if I go to localhost this site doesn't yet have any of the content so if I go to administration and content it didn't do any migration so there's no content there's no content items yet and there's like all the all the different settings and views and all that kind of stuff is still not on the site but it did supposedly migrate this configuration so let me look back to the upgrade using dress setup generate migrations and if I tried rush migrate status let's see what this says now after I did the my great upgrade configuration only let's see what my great status tells me so it looks like now this is very good news I'll make this a little bigger hopefully let me see if it's okay it's not being hidden oh where did I go I think my camera so I just that's not right okay I'm back that was interesting I just realized I left my battery in my camera and if you leave your battery in the camera and it's a mirrorless camera the battery gets burned through in about 10 minutes so I just put in the power supply and now it should keep working sorry about that but anyway this is good news it looks like it's seeing all of the content so it's seeing 2657 files it's Ian blog post 2,850 so it's seeing all these different things there's setting some settings and formats menu items I have a pretty simple menu for a lot of sites with that are much larger you'd see tons more tons more menu items and things like that there's 24 project nodes 2 page nodes that's I guess I have like the the about page as a page so it looks like it got everything here so I'm going to look at what to do next it looks like the next thing would be to do an actual migration and see if that works migrate import all I'm gonna go ahead and do that and while it's doing that well it's doing that I'm going to also show you something that is important to do for making sure that you know I can do this again over and over again and I can start testing it because as we start getting into this now that we're actually doing work on the site that's that's making changes I want to make sure that I can redo this stuff over and over again so now that's doing all these migrations probably once it gets to file or note it's gonna take a long time let's see block content entity type does not exist I'll get to I'll get back to the repeatability in a minute let's take a look at this this is interesting because I think I think that this is saying basically like there's some of the blocks on my old site to be migrated to blocks on the new site but there's no block content type and Drupal 8 by default and that's causing an issue it's interesting though because you'd think that that would be something that it would it would see like oh I need to create a block content entity type because it didn't exist in Drupal 7 so let's look at what we see if we Google that and it looks like there's a couple issues for it already so I'm going to look in here works is designed if I do this I get that error message you don't have the block content module enabled to do this is interesting so what is oh so it's trying to do these things that's funny because D 6 upload field the site did originally come from Drupal 6 own or if there's some old junk sitting around in there if I just need to do this let's see let me get back to here - all right so I should probably just do the group migrate Drupal 7 and I'm also going to start documenting this because I'm going to start getting confused as to what I'm doing and you were ready to migrate content in the Drupal 7 site database run what is it my great rush import or dress my great import oops and he's saying group - - group migrate Drupal 7 is this group of group of content to do that and also I need to get and enable this module it looks like so I need to enable the block content module so that can migrate blocks from Drupal 7 into Drupal 8 and also since I fixed this issue I'm gonna go ahead and close it fixed via the above commit using Josh nine point seven X and also updating the settings that PHP file to use the docker for Mac OS alright so I'm gonna close out that issue and go back over here so I need to enable this block content module so I'm gonna go to extent I could do it with Josh I guess but I'll just do it in the interface actually I probably should do it was thrush because this page will take like 10 seconds to load actually it didn't take too long alright block content is there a block content module block there's a block module yeah there's a custom block module is this the block content module no well here's a fun thing in Drupal I don't remember when at some point with with the custom labels for blocks like the block name is there the module name is block content and the user name is custom block if I didn't know that the machine names of modules are hidden away like this then I would have never been able to figure that out just looking around so that's kind of a that's one of those little Drupal a mini Drupal WTF the module name and what may Amin Tanner's refer to things as often different so in here it says you know this seems to indicate you don't have this module enabled so I'm like okay I'll enable that module and I'm like where's the block content module I don't see it anyway another small aside so I'm gonna enable that module install install that module I should say in Drupal 8 its install or uninstall there's no enabling and disabling there's in Drupal 7 and below you could disable a module and keep it settings around and Drupal 8 there's no disabling its you could basically remove the module or install it module and that's it I'm also going to put a note in here I mean I'll do this in a blockquote yup great using dress guide and the docks and just a note that the lock captain man's name is custom lock in the UI alright so again anytime that I see a little issue like I just had I like to put a comment if I have anything more to contribute to the discussion put a comment into the issue queue that way not only do other people who have the same issue get a little bit more information that might help them inevitably the next time I do one of these migrations I'm gonna have the exact same issue unless it's fixed but I'm guessing it won't be by that time and so I'll see oh I did this before and that's triggers a little memory that oh I I know how to fix this that's easy and of course my computer is like let's see is this okay so block content should be what does it call ya block content should now be enabled and I'm gonna go ahead and run I'll run this command not all and we'll see what happens next all right so I left that comment and another thing that I'm gonna do here is I'm going to add a new issue export site configuration into code repository and then I have instructions for doing this on what is that the true fall for kubernetes so it looks like migrations are running let that run in the background hopefully there won't be another error there is another error that's annoying it's busy with another operation okay so put this on pause for a second it says that it's busy with another operation importing so this happens sometimes if you run a migration and it like stops midway through and breaks or there's an error like we just had earlier and then it gets stuck in importing status so if I say migrate status drush migrate status in here it should say that it's whatever that migration is upgrade d7 block it'll say that the status of it is importing and you can since we know that it aired out and didn't complete I can go in here and basically tell it to reset itself back to idle and I forget what it and gets like migrate reset if you just run drush that'll give you all the commands available so I'm gonna run rush it'll sit there killing my CPU for a few minutes and if I go to migrate migrate reset status okay so there's a command because this happens sometimes if it if it fails in the middle of a migration you can reset the status manually back to idle so I'm gonna say migrate what was it migrate reset status mrs these are the shortcuts for all these things so migrate rollback is mr migrate statuses MS and reset statuses mrs so i'm going to do rush mrs and what was that migration it was upgrade d7 block I think you just based it like that let's see and again that's rush migrate reset status upgrade d7 block and it just the reset at the idle so now if I go back and run this migration I'll let it go and it should hopefully pick that back up and keep going and hopefully we won't get another error message so I'm going to go back over here for this exporting the site configuration I want to do this so that every time I reinstall the site I get all the configuration including all the migration configuration from the code base so that I can track it using git so if I make changes to migrations it's tracked in my repository so I started the new project configure the site and make it reproducible as the document in here that I am looking at so I had it know there's there's a few errors here we'll look at those in a second that's good to hear so that we can actually start tracking the configuration we're gonna use Drupal's built in configuration management system it's nice to have the admin toolbar module will enable that later at some point go to here add those modules we already we already installed some other modules now I'm going to export the configuration here using brush config export and this is basically connects porting all of Drupal's configuration into one folder and we'll see if that should be in that should be in a folder config in here I think let's see what happens if I just run Josh config export and should go into config slash sync by default that's not the folder I want and get exported into here yeah this is not now I don't want it in my files folder I'm going to delete this folder that it just created so apparently the default is to write it into the site's default files which is a public folder I don't like that idea even though I'm guessing that this file says like don't don't allow reading from those miles or something but I don't like that I don't like have any anything in my public files folder that has to do with the site's configuration or even these PHP stuff I don't really like it in there but with Drupal that's the way it is just because that's a public folder on your web server that people can read from so I need to override that config sink directory Drupal 8 settings dot PHP I know there's a setting to say where do you want that directory and apparently that a fault is not there anymore so I'm again so it I noticed this issue this is my own project but I noticed an issue with it I noticed that on this page my documentation is wrong so I'm gonna open up a new issue and say Drupal's default config sync directory is in public files Doc's are wrong so that from this page instead you need to override the sync directory in your settings that PHP file and changing the storage location so this is where it tells you what to do and we want it to be in a different directory config sync directory here we are and this is where we want it and pretty sure okay see for more details so I'll save that related all right I'm gonna create this issue just I don't forget to create it and so what we want to do is update this to write it into a config sync folder that's in here so it's outside of the web root because I don't need the configuration for the running website I need the configuration when I deploy the website or when I update the website or when I'm developing so I don't need that to be end user accessible oh and somebody's posting in there whose name I cannot read the config sink config directory sync path so yeah I'm going to go settings that PHP and go down to the bottom no yeah it looks like it wrote this directory when it installed Drupal so I can just say it's interesting settings config sync directory so in here it has this and then someone in chat posted config directory sync and then in my settings that page we have settings config sync directory like with which one of these settings is it actually I'm gonna I'm going to override this just to see if that works and copy this out and paste it there so let's see if that works if I say Josh config export if that exports into the config folder it looks like it might have worked yeah there's the config folder look at that how wonderful so now what this did was every setting in Drupal that is is able to be changed in the interface or be a dress or anything it's all in these Yamla files so all these migrations that we just generated when I use that config update command all those are in here so if I go to let's see the upgrade d7 file these are all the settings for the file migration so it has the source base base path that we entered on the command line it's public files and it knows you know the mapping of where it was in Drupal 7 and where it will be in Drupal 8 so this is good so now we have all the config here and what this does is it's kind of cool if I say drush migrate status and you can see it has all the configuration that we have what I'm gonna do next is let's the existing in Figg what I can do next is install the configuration from that this folder so that I don't have to if I'm reinstalling Drupal I don't have to rerun the commands to generate the migrations and then Regent rerun the migrations and all that kind of stuff every time that I do it so I'm gonna go existing config here in this install command and I'm going to go ahead and you know you might think it's crazy if you've never done this before but I'm gonna go out of this docker container I'm gonna say docker compose down - V that deletes the containers deletes the my sequel database deletes everything in there I'm going to delete it all and I'm gonna reinstall Drupal and using this existing config flag tells drush that when it's installing also import all the configuration from this directory so all the work we've done so far on the site up to this point will be reinforced in nage and I'm sorry if I'm butchering your name it says it changed in a recent version of Drupal 8 so it looks like this let's see and this is a let's see so here Drupal 8.8 it's defined in settings ah so I just didn't read far enough I was reading up to here and then I stopped reading but down here it says this changed so at some point when everybody's on Drupal 8.8 and later this this part up here should probably be updated but anyway that's that's good to know alright so I deleted everything if I go back to my site which and I have it open somewhere yeah so if I go back here and hit go it's it's not there it doesn't exist anymore so I'm gonna make a new new instance of it it'll be very fresh and empty and void of all life forms of Drupal kind and if I go to localhost right now Drupal is not installed so it's gonna give me an error message which is good the error right now is because my sequel is booting up I'm going to say docker compose and Long's - F this lets me follow along the logs of the containers that are starting and so you can see the my sequel containers still doing a bunch of things the first time you start the my sequel container it has to set up the databases and all that so it's still doing all that and until that's done Drupal is going to give you error messages like this so we're just gonna wait for that to finish setting up my sequel almost almost we're getting there it's so close no it looks like it's running now so if I go here it's probably gonna take me at the Installer or some other error message page because Drupal is not installed right now yeah and it looks like it's taken me over to the Installer so I'm going to run this command is this the right command it's the Drupal okay so let me get out of here docker compose execrable so this is gonna run drush site install minimal with the existing config so let's see if that works my computer is dying right now but the stream looks like it's still working so that's good alright so I'm gonna get out of the Installer I'm just wait here so now Russia's doing its installation I'm going to take a drink of water well I didn't stretch a little bit that's 1042 so I hope they'll be able to see the fruits of the migration or at least get back to that error message that we saw a minute ago but the nice thing here is like now that I have the configuration for the site and now that I have a command address command to run to reinstall the site with that configuration any changes we make to the site can be redone easily so this is annoying we have error messages why is it trying to install Bartek system main and Bartek user login depends on the Bartik theme that will not be installed why oh these are probably blocks so this is one fun thing sometimes blocks that were in use a long time ago from a Drupal 7 site or even a Drupal 6 site are still in the system and they depend on themes that might not be in your Drupal 8 site or might not be enabled so what I think I'm gonna try to do I'm gonna see so let's see Bartek system main I'm gonna do two things when you know you have to be careful manually modifying Drupal's configuration files that it dumps usually it's not a great idea but if you know what you're doing you can do it and it usually doesn't blow things up sometimes it does so I'm gonna look for this new your ID to see if it's used anywhere and it looks like it's still searching if it's used somewhere else then I can modify that file to remove it so it's not used anywhere else I'm also going to look up if this idea appears anywhere else and it looks like it does in a test and a migrate bloc test so that's okay because the test doesn't run unless you run the test and that would set up its own things so I'm going to delete this Bartek system main because we don't need that I don't even use the Bartik theme on my Drupal 7 site so I know that I don't need it I'm gonna look for this one no match is found and look for that one there's a test to test okay so those are just in tests so I can delete these two I don't need them let me try driving this again and these blocks that it's finding these were actually from these were probably from the actual migration I ran so I probably shouldn't have done an actual migration until after I committed the first working set of configuration so I kind of I kind of what do you call it I tied a hand behind my back here by doing that and now I have to work through these block issues I might have to delete all these blocks that were exported because I don't want them to mess up the configuration so wait for this and it'll probably air out on another on another one of these blocks and if it does I'm just going to delete all the blocks I make sure none of the other ones are used anywhere I was doing that nope okay so if it errors on that on the blocks again then I'll just remove the rest under fight I think I'm using I'm not using the stark theme let me see just killing that calm I thought I had a custom theme yeah this theme is based on boron which is a very old not maintained theme but it was html5 back when html5 was a new thing back in like 2012 2014 2010 I don't remember when that was but apparently an early version my theme might have been based on stark anyways there's some fun drupal history garland I forget the full history behind it but garland was in some ways a cool revolutionary theme back in Drupal 6 days because it had a really cool like translucent header area and these menu items that were fluid and head hover States and things it's funny how the web changes nowadays that kind of stuff is not like nobody cares and it's all mobile first so half that stuff doesn't even flow that well in a mobile-first world mmm this is going it seems like it's not failing so that's actually not so bad but I I would think it would fail on on these blocks we'll see what happens yeah it says it's completed so here's my admin password and if I go to localhost let's see what I get if I go over here and log back in to that docker container and rush migrate status so MS is migrated status we'll see if it sees all those migrations it should and look it even picked up so since since I did a migration it picked up some settings like it grabbed the site slogan web developer and photographer it's also seeing page not found here which is funny I'm guessing it's trying to find the view so in Drupal let me login and Drupal you can set the front page of your site to any path in the system and I think I have mine set too let's look it up right and now that I'm logged in I can go to administration and then is it in settings or something if the administration ever loads I can look mouse is doing that I'll just go to Jeff Keeling calm says homepage is where is it system site information I think yeah so the home page is slash home and home is a view I think maybe mm-hmm maybe it's not I don't know what home is maybe home is a page and got a type page apply yeah home is a page with the URL of slash home and so you're all path yeah so the URL aliases home and the page title is home so until that page exists if I'm on this new site until the home page exists which doesn't exist yet because it hasn't been migrated because it's content on the site it's going to give me a 404 on the home page because it's trying to find slash home but that page doesn't exist and it looks like it also sees all these nodes so that's good and we can go ahead and try running that migration again but before I do that I'm going to you X since I exported the configuration I'm going to add it to the git repository because it looks like things are working here a lot of settings are already coming across and my site looks I mean look at this it's so close you have Jeff Garlin and Jeff Garlin that's I mean we're all we're like halfway there at this point that's a joke hopefully somebody laughed but since I can't hear you I don't not sure all right so those blocks are okay I'm gonna go ahead and commit this let me make a note here I'm gonna make a note of what the command is for expert in the content which was right here yeah wait thank goodness I'm getting all mixed up so I'm gonna make a note there and I'm gonna say I can remove that now configuration anytime configuration has changed or any modules are Drupal is upgraded you should export the site's configuration using the command that and then push any changes to the repository or did playing oh you can't see some of what I'm typing can you a new version before deploying latest code to the site okay so I notice that I'm I'm updating my documentation as I go I think in the first episode I mentioned like this readme file is where I kick off on all my projects and if I didn't document this here I would probably spend at least a minute every time that I ever want to work on this again in the future because I don't work on my Jeff currently that kind website daily probably not even monthly and so I would forget these things you know it's only muscle memory if you do it a lot and you know I do know I think drush config export is also drush cex I don't know if you can see that what I just typed might be behind me but anyway drush cex i know that from muscle memory of doing this a zillion times but a lot of other commands like this install command I you know I'm not gonna sit there and type it out all the time so having it here to copy and paste from my readme is really helpful so I do that a lot with my projects and I'm doing it here because now even if if you know there's there's a thing called the bus factor if you don't know what it is factor the idea is you know I run Jeff killing calm and you can read about it on any of the links here Wikipedia is fine too if if I were to get hit by a bus or as as a co-worker of mine once said it let's not think about getting hit by a bus let's say if you won the lottery and flew off to some other country and weren't heard from again another developer could pop open this readme file and know how to do everything anything they need to do to get started with this project to install Drupal to run the migrations all that kind of stuff you know any anybody on this live stream could pop in and grab this and start working on it from here so that's why I document all this stuff and for me I'm very forgetful so this is helpful to me too so now we have that command we have the content and I'm going to say git status should have the entire config directory so I'm gonna say git add a and then run git status again to see so it's going to add all this configuration get commit - M fixes number what was this issue number six export site configuration in - code repository and get push it and since I had that fixes number six it's actually gonna automatically close this issue once it comes up so it closed it automatically and it has the commits that closed the issue which is a nice feature of github and get lab and some other some of these other web-based get browsers so that's good we have our configuration we have a reproducible website and I think it not in this episode but maybe next episode I'll even set up continuous integration in this git repository so every time I do a commit or create a pull request or anything like that it runs all these tests like it installs Drupal make sure everything's working still because that's also helpful especially like I said if I come back to this in two months I I don't want to have to remember everything about the site and what I need to test and all that just to make it little tweak to something but sometimes a little tweak can break things so continuous integration helps prevent that okay so we're there and we want to run this migration again and see what the error message was and that might be that might be what we stopped at today so let's see let me go back to the readme so we're gonna do the migrate import for the Drupal 7 group and we'll see where that gets us too someone didn't lol so somebody laughed at that joke I made a couple minutes ago that's good that makes me happy this is funny filter null I don't know why there would be a filter plug-in called filter null but apparently in my Drupal 7 site something was seen there I'm gonna actually pop this into an issue just so that I can look into it later it's another one of those things where when you're doing a big migration you want to you want to keep track of all the little things that you don't fix because it could lead to bigger problems later so before I get to those other red error messages I'm going to say let's see it's this migration is causing that migration causes missing filter plug-in filter null when I run this I get the message I'll copy this whole message out might be some error with the general Drupal seven to eight migrated upgraded path for now not a major issue but look into it later alright so sometime in the future I can google that and see if there's any other people with the same issue and figure that out but we have a bigger issue there's lots of red and there's lots of red that means it's a big issue and josh'll says we can automate this with a docker compose file yes and no Sai I can automate some of the things more or less so that I don't have to do all these things all the time but there are times when I want to install the site but not run a migration or do some things in that export configuration or not have the configuration imported depending on what kind of things I'm testing or if I'm just doing theme development I don't want to spend ten minutes waiting for everything to migrate over or in other cases like if I'm sharing this project with five different developers and two of them are just doing theming work they don't they for security reasons we might not even want them they're in an external agency we don't want them to have access to the old data for the website so they wouldn't have database access they couldn't do the migration so I generally like to have the docker compose stuff only set up the environment not to like build everything and it you know if you use like Drupal VM or D dev or one of those tools you can have it do more stuff when you set up your environment but sometimes it's not desirable to have it do everything at the same time especially when there's like I said you know the teams that are dispersed and different people have different roles that they might not have access to all the same stuff that you do you can also have a sanitized database that you ship with the codebase for the migration but sometimes that doesn't work out so well especially if you have gigabytes of database luckily my Jeff Caroline comm is like a hundred megabytes so it's not that big so let's see what we got here attempt to create field project type with no type that's weird so it's trying to create fields without a type I don't know why there would be no type here I wonder if that's another missing module I'm going to go ahead and search this issue on drupal.org because that's that's sounds to me like maybe the minimal install profile doesn't include that module Drupa that's a migrate and then paste that error message but I'm going to delete this field because other people might not have that same field no mapping let's see if your storage [Music] I don't know which one of these it would be ah so that's for a particular type of field this is an interesting one I wonder oh here fell discovery field discovery failed for Drupal core version 7 this is weird I'm gonna create a new issue for this since it's 11 o'clock and I actually have another thing to run to I'm gonna create a new issue for this getting and migrating all message so I'm gonna pop this into a new issue on my repo and we'll look into this next week I'm guessing that this is something that I'm missing a module or something along those lines maybe missing field related module look into it next okay so got that it looks like so this week we got to the point where we have all of our configuration for the site stored in the codebase we have all the migration configuration set up and it started migrating some things like settings like the site slogan I'd never entered this into the site the migration did this for me so that's good and the home page is set to slash home but obviously that page doesn't exist yet because we haven't migrated the pages so looks like looks like that's all done and it looks like there's one question here people say developing a site on d7 is faster there's that's we could go into a whole hour long discussion on that it depends on what you're talking about and what you're doing there there are some things that can be faster on Drupal 7 and there's a lot of things that are faster underplate and there's a lot of things that are easier under plus 7 a lot of things that are easier on Drupal 8 when I talk about Drupal 7 and 8 and compare the two there's a lot of times where it's like Drupal 8 is different it's not worse or better sometimes but it is different in some cases I think it's a lot better like the configuration management stuff is a thousand times better than what we had in Drupal 7 being able to replicate things in Drupal 8 is a thousand times easier moving content around between sites or if you have like a staging and live site you can move content between the two so much easier and Drupal 8 but anyway just in general the question of developing on d7 is faster one of the few cases where that is true is like if you're using docker for Mac and there's like 10,000 files in Drupal 8 PHP files that ask to load on a fresh page load in Drupal 7 there were only like 2000 so in that case general page loads can be faster but anyway I've got a couple minutes over and core to a good point here where we have the migrations running and we're just hitting some errors probably related to modules that are not installed on the Drupal 8 site if not we can probably figure out what's going on using the power of Google next week and again if you want to make sure that you don't miss these these episodes please right below me right here there's a subscribe button there should be yeah I'm looking on the iPad it should be right below me and on the desktop and probably mobile devices it might be different depending on what you're looking at hit that subscribe button and if you're not like me and like to be notified and get lots of messages on your mobile device hit that little Bell this the notification bell that'll also send you a little notification when you when I start these live streams and I'll be back next Tuesday at 10 a.m. central or 4 p.m. UTC and I'll see you then thank you very much
Info
Channel: Jeff Geerling
Views: 2,748
Rating: 5 out of 5
Keywords:
Id: lP7RHTu7K0k
Channel Id: undefined
Length: 63min 6sec (3786 seconds)
Published: Tue Feb 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.