David Golding



Easy File Transfers Between Remote Hosts

By David Golding

I’ve just moved from one web hosting provider to another one. But getting large web sites from Host A to Host B can be challenging and time-consuming, especially if you have less than a T1 connection. Let me share with you how I was able to move a 1.3 GB backup file from one host to another using ssh.

First, I logged into the new hosting account via ssh:

ssh username@new-domain.com

Then, just a matter of using command-line FTP, I was able to move the file from the previous host:

ftp ftp.previous-domain.com
Name: [username]
Password: [password]
cd [to directory]
get [filename]

That’s it. What’s nice about this is that the file transfer occurs between the new hosting server and the old one, which undoubtedly have a better internet connection speed than my current one. Also, it removes the task of having to download the backup file to my local machine, and then upload it to the new host. As long as one of the hosts doesn’t impose a bandwidth cap, this should transfer the file much more quickly than if you were to add your local machine to the process.


Comments

4 Responses to “Easy File Transfers Between Remote Hosts”

Justin

Aug 6th, 2008, 2:41 pm

In the intro you said "getting large web sites". Doing FTP isn't going to get a large SITE over to another host. It's going to let you move the contents of one folder over at a time if you use "mget *". However, this is very problematic because you've got to pre-build the directory structure on the new host and then walk the directory tree while FTPing files. It's a major pain.

However, if you used rsync, you could replicate the entire folder structure of the original host over to the new host with just one simple command.

David Golding

Aug 6th, 2008, 5:30 pm

@Justin

Well, of course you wouldn't want to move each file over at a time. You'll notice that I stuck with a backup file that I decompressed once it was moved to the new server.

You're correct. rsync is a good idea for duplicating the folder structure from another source. But I still find compressing the whole site, moving the one file via ssh and ftp, and then decompressing the backup file a quicker process than rsync. It all depends, though, on the circumstances of the site you're moving.

Justin

Aug 6th, 2008, 5:48 pm

@David

My apologies. I didn't pay enough attention to the "backup" & 1.3GB. So, the rest of the post seemed as if you were suggesting a file by file transfer.

Justin

David Golding

Aug 6th, 2008, 5:52 pm

Ah, no worries my friend!



Submit Comment


Beginning CakePHP: From Novice to Professional by David Golding

David Golding

A blog about CakePHP, web design, and grad studies in religion. © 2008, D. Golding