Using rSync to transfer a site?



Both my old hosting provider and DreamHost offer rsync. (And both also offer SSH.)

I am wondering if it is possible to use rsync to transfer the contents of my old site over to DreamHost.

I am guessing that I would set up a daemon on SiteA and then execute some command on SiteB. But I have no idea what the command lines would be.

Perhaps someone out there could give me the step-by-steps and the command lines I need to use? I want to copy the “whole ball of wax” from




including/recursing through all subdirectories.


I’ve never used rsync before, but it sounds like you could use scp to do what you are looking for. You should double-check with man scp, but I think the following should work from your dreamhost shell:
scp -pr userA@ServerA:/fullpathto/public-html

The command should prompt you for your userA@ServerA password and begin the transfer. The p option preserves the permissions and the r option makes it recursive.

I hope this helps.


Thank you for the tip!

I get two errors when I try this command:

stdin: is not a tty
scp: /public_html: No such file or directory

I get the second line no matter what directory I’ve tried to specify. The first line is Greek to me.


I’m not exactly sure what those errors mean. According to Google, the “is not a tty” may be caused by something setting “mesg n” which seems to screw up scp. As for the other error, can you confirm the full path by typing “pwd” from the public_html directory?

You might want to try to initiate the copy from the other server. In that case, you would ssh to the parent directory of public_html and type:
scp -pr public_html
where userB is your dreamhost shell username. You should verify with “pwd” on your dreamhost account that /home/userB/ is the full path where you want the stuff to go.

Let me know if that helps…


To use rsync its very similar (could be the exact same) as scp but with rsync you can also copy permissions which may or may not be nice. To do that use the -a flag (it’s for archive mode, which creates an exact duplicate…permissions and all).

The useage would be:

siteA = non-DH site
siteB = DH

Login to siteA via SSH and go to the root of your website(public-HTML). From there:

rsync -avr ./

the -a flag is for archive mode, the -v flag is for verbose mode (so you can see what it’s transfering), and the -r flag is the recusive mode so it will transend into all the different directories.

The “./” is copying everything from that directory down the chain.