Ready to watch this entire course?
Become a member and get unlimited access to the entire skills library of over 4,900 courses, including more Developer and personalized recommendations.Start Your Free Trial Now
- View Offline
Drupal 7 Advanced Training was designed as a follow-up to Drupal 7 Essential Training and it also dovetails nicely with our other Drupal courses, such as Drupal 7 Reporting and Visualizing Data and Create Your First Online Store with Drupal Commerce.
- Moving a site from the development environment to production
- Hosting a Drupal site
- Moving databases with phpMyAdmin and Unix commands
- Making site administration more efficient with Drush
- Backing up site data
- Moderating comments
- Migrating from previous versions of Drupal
- Working with themes
- Creating variable layouts
- Enabling social features
- Creating an online store with Drupal Commerce
Skill Level Intermediate
When we last left our migration project, we'd finished all that we were going to do with Drupal 6 site. Now we are going to replace the Drupal core with Drupal 7, and as I mentioned before, at this point, you'll no longer be able to use your Drupal 6 site, because we're going to delete the entire set of software and then we're going to run a database update. We made a backup when we first started. If you didn't, do so now, here we go. We then click Replace Drupal core in the Upgrade status module. This gives some fairly complicated instructions, so I'll go through them step by step.
First, Create a new virtual host, and it suggests one to create. I've already done so at d7.tomgeller.com, and as you can see there's nothing there. We just have to remember to use that URL; instead of the one it suggests whenever it mentions it. Then I download the new Drupal core into that directory and it conveniently gives me a link to that page. Go down, copy the link, and then go over to my site, where I'll go back up to my Drupal 7 site and download there.
Right now I am in the middle of my Drupal 6 site, so I have to go up a few levels. Yup, I am in the right place. Because I have Drush installed, I can use it to download Drupal. By default, it will grab the latest version of the most current integer versions, so in this case 7 point whatever, yup 7.12. Then as I've done elsewhere in this course, I bring it up one level to put it at the root level of where my web host is looking for this site.
You might not have to do this. We go back to our instructions, and it says to Copy all of the existing modules from the old version of Drupal core, into the same location of the new version. Here it really helps for you to know exactly how your web host is set up; fortunately, I do. Remember, when you're doing this in UNIX, it's cp -R for recursive; otherwise, the command will fail. And just to be sure, let's take a look in that directory. Aha! We made a mistake, you see, we copied modules into modules. That's okay; this sort of thing happens all the time.
Just go into it and move everything up. Now I can remove that modules directory that's inside the other one. Very good! Now remember, we have a Drupal 7 site with Drupal 6 modules, but don't worry the upgrade process will take care of that. Next, it says to copy settings.php and the files directory to their identical locations.
Now I am going to go back into my Drupal 6 site and do it from there, just to make sure that I'm copying the right files directory. If you're running a multisite installation, or if you move things over from Acquia Dev Desktop, you might find the files directory isn't quite where you expected it to be. So now I am in my lyndad6; that is the Drupal 6 directory, and good, since I'm not running a multisite installation, files is probably in default.
And that's also where my settings file is. From here I'll copy over the settings file. First, I'll clear my screen and then do copy settings (cp settings) and then from here I have to figure out where I'm copying it to. One nice thing in UNIX is that you can find out where you are while traversing directories, by simply hitting the Tab key twice. That's the top level of this Drupal directory, so I'll go up one more and then into lyndad7/sites/default. Good! That made that copy.
Now we also need to copy the files. So same thing, but this time remember the -R. All right! That takes care of our next step. Now we go back and run the update program and remember, we changed the domain, so we'll do it from the domain that we named. At this point we're completely converting the database over. So here we go. Go to my site and update.php.
But we do get an error. At another point in this course, I talk about all of the things that are in the settings.php file. One of them allows you to update the site if you're not their super user. Now remember, we didn't actually install the Drupal 7 site yet, so there is no super user. We have to go into that settings file and then change it, so that we can update it, then change it back. So we go back to our Terminal, go to our lynda7/site, and edit that settings.php.
The thing we're looking for is this update_free_access. I'll change that to True and write it out, then go back and reload and Continue. Notice, there's lots and lots of updates. This process will take a few minutes. Now notice, we get a few informational messages here. I am going to Command+Click those links just so I have them in the background and can take care of them later.
This one is just informational, so we can ignore it, but then we have a warning here to reset that value. So I'll go back to my Terminal and do exactly that. Change it to False and exit, saving as we go. Now we can go back to our front page. Now remember in our previous video we put the site in maintenance mode. But we were logged out during the process so we're no longer the administrator. If we were, we would see the full administration screen here, so we have to log in again.
We do that by going to /user. And in fact, we want to stay in maintenance mode because we haven't completed the process yet. Now we are on to Download new project versions. There are a few ways of doing this. We could do it manually and here it helpfully lists all of the modules we'd have to update, along with links to their projects. But it also provides this drush command here.
Now notice, it says the delete option may not be supported yet. Let's just give it a try. I'll copy it, clear my screen; make sure I am in the right place. Yup, I want to be in the Drupal 7 site where we just downloaded that software and I'll try that command. Nope, it's not implemented as I make this video. It may be by the time you watch it however. So instead, I'll go back and manually delete them. But notice, only those that are going to be replaced. That is, everything except for upgrade assist.
And of course, those are in our modules folder. Now I'll reissue that drush command, clear the screen and remove that dash, dash, delete. Now you'll notice that the process gave us a few warnings.
You want to take note of which things it's giving warnings about. There's upgrade assist, image assist, and upgrade status. So we saw an upgrade status, but it's probably the old one. Once we've finished that, I'll reload the page. Scroll down, it tells us once again to run update.php, and we have more updates to do, these are of course on the modules.
And we get some warnings, which we should take note of and take care of later. But for now, I am just going to go back to my front page and see what the next step is. We are almost done. The next step is to re-enable modules. We get a warning, but we can re-enable some modules, so we'll do so here and Re-enable. Then I'll reload the page. Now this is the tricky point.
We can check on which modules were re-enabled, by going to be d7.tomgeller.com/admin and then following the path. Normally of course, we'd use the toolbar, but remember we disabled all of those modules in Drupal 6, and toolbar wasn't even in it. So we have a very bare kind of site right now, administratively speaking. But let's see what the modules are. There is CCK, we might want to start re- enabling things here, the Image module, Pathauto, Token, but there is a problem with Upgrade status.
That is of course because this is the module that we carried over from Drupal 6. Then we find additional errors such as Ctools, which is necessary for Views and so forth. This is where things get tricky. You're going to run into some modules that simply don't exist for the new version. There are a few things you can do for that. First, the functionality might not be necessary. That is, it might be done in a different way in Drupal 7. One example here was the Image module. That's actually part of Drupal 7 now, and so we didn't really need it.
Take a good look at all of the modules that you were trying to bring over, and talk to an experienced Drupal 7 consultant if necessary to figure out if that's the case for the ones that you have. The second option is you might be able to replicate the functionality using a non-Drupal solution, such as the free apps from Google and the like. Third, perhaps you could help produce the Drupal 7 version. This helps not only you, but the whole Drupal community. Finally, if none of these are possible, you might just have to adjust your site to do without the features that you had in your previous version.
In any case, you can often figure out the best path by looking through the modules image queue. For example, let's take a look at that Image Assist module. Go into the issue queue and do a search for Drupal 7 let's say. Ah! And it says right here, the issue having to do with the Drupal 7 port. One thing that we didn't do is to take care of those pages that we opened after we had installed Drupal 7. Now that we are logged in as user1, we can reload those pages and make whatever changes are necessary.
And then finally, after we've got all our modules together, we check our status report, and finally go online. So that was a long process, wasn't it? And you can see that it's tricky. But the update status module makes it much easier than it used to be. The problem is also somewhat ameliorated, because the Drupal community hugely maintains both the current version and previous one of any given module.
That is Drupal 7 and Drupal 6 in our case. So you have plenty of time to make the change. And as long as the modules you need are available, the procedure really isn't so hard.