Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
I briefly discussed how to move Drupal files between your development computer and web host in other courses, such as Drupal 7 Essential Training. Here I'll go into a bit more detail using three different file transfer options. In that course I used a file transfer program called FileZilla. You can find it by searching for FileZilla on the web or by going directly to filezilla-project.org, I've already installed it. Once open, it shows your local computer's files here in the left side and then you connect your remote computer by entering the information up here.
So here's my web host, you'll notice that there are quite a lot of directories in here and it's not always clear exactly what they are. Many of them have a folder called public_ HTML and that's where you put your web files. On my particular host, it's webapps, but it's the same basic thing. If you have any problems figuring out where to put your web files, talk with your web host. From here it's quite easy to move things in and out. For example, I'll open up this lynda folder and drag in this test folder. Simply drag it in, and there it goes.
Inside that test folder it copied all of the files inside just as you'd expect. You'll notice there is a two-dot folder right here that works very much like UNIX, where you type in two dots to go up one level, and we're back up, and back up again. You can also drag and drop between these two windows to go from your local machine to your remote machine, and back again. So that's one method. If you have any problems with it, check FileZilla's documentation, or again, contact your web host. By the way, there are several file transfer programs available for free, on both Mac and Windows.
Wikipedia has a huge list of them. You can see them by going to en.wikipedia.org, and then search for ftp client, and as you can see it's an enormous list. I personally use Cyberduck on the Mac, which is free and open source. A second method to get files between your two environments is to use whatever graphical interface your web host provides. As in a previous video, I'll show you what that looks like using cPanel, which is one of the most popular of such interfaces.
You can try it out by doing a Google search for cPanel, and then clicking Try Demo. Scroll down to Domain Owner Panel and click the Demo, and you see down here this file group. You click File Manager and then go to whatever area you want to take a look at, I'll just say go, and as you can see double-clicking folders let's you get into them, you can move things in and out using the buttons up here, and so forth. We don't have to go into details, because it's quite easy to explore. Finally, you can use UNIX's command-line interface to move files.
The command you'll use is called SCP, which stands for Secure Copy. As is usual with UNIX, it's a little daunting at first. I give a brief introduction to UNIX commands in the video using UNIX's Command Line Interface, and if you want more details, watch the series UNIX for Mac OS X users. The first thing that I need to do is figure out where the file is that I want to transfer it to my web host. To do that, I'm going to go back to my Finder where I've already created a folder here called test, which has a file in it, test.txt.
Now there are few ways you can find out where this is. One would be to use the Terminal program and I could then just navigate to it. Let's say ls, cd Desktop, ls -al. Once I'm there, there's test, cd test, pwd, and we have the full path right there. A simpler way on the Mac is to simply highlight it and hit Command+I and that gives us the path right there; there's similar things on the Windows side. In any case, once you have the path of the source file, you then go back into your Terminal and you type in the command scp -r, paste in that path, put the name of the file you want to move, in this case it's a folder, test, and then put where you want it to go, firstname.lastname@example.org:test.
Now if we look back at this whole command: scp is the sommand, -r means recursive, that means copy everything inside the folder. Here are our two arguments to it, this first one is the source, and the second one is the destination, user @ destination domain at finally where it's going to go, and then I hit Return and, of course, it asks me for my password, so that I can log in to that destination. If you mistype your password, of course, just try again. You get up to three tries before it kicks you out.
It took only a second, because it's a very small file, but there it is. We can prove that it's there, but using ssh to go to our remote computer and then take a look. So ssh to an ls -al and right there is our test folder and inside that is test.txt. To be honest, the easiest way to do one off uploads and downloads like you saw here is probably just use your web host graphical interface, such as for example, cPanel, but I personally like using the other two methods sometimes.
One reason is because both of them, that is, UNIX commands and file transfer programs are scriptable, so you can automate such things as backups by just writing a script. Whatever transfer method you choose, get to know it really well. The more comfortable you are moving files between your development environment and the server, the more likely you are to follow good development practices.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101504 Viewers
61 Video lessons · 88266 Viewers
71 Video lessons · 72134 Viewers
56 Video lessons · 103896 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.