This will start as a partial post regarding transferring a complete site from one server to another using SSH or how to copy files from one server to another using SSH. This outline is intended to be helpful for Magento users that may be transferring their Magento Commerce site from one server to another, but obviously these directions work for moving any kind of directories or website files.
First, you need to login to the server you want to transfer the files from using SSH.
You then need to login as a super user using the command line prompt: su
Enter the super user password.
Navigate using cd to your directory you want to backup, copy or move.
Use this command: tar -cpzf magento-3810.tar.gz ./
This creates a complete tar.gz file of all files and directories in your directory.
I use this procedure because I want to make sure I’m doing everything correctly. You could actually transfer the entire site from one server to another, but if you’re working with live sites or have a lot of work involved without a full backup, you want to have some feeling of security.
So next, I FTP to my server where I just created the tar.gz file and transfer that file to my local machine. I then unzip and untar the file and have a look over things just to be safe.
I then, trnasfer by FTP the same tar.gz file over to my new server directory.
Now, that tar.gz file is on the new server.
Go back to your shell screen.
Navigate to where you just put that backup file.
Use this command to untar the whole thing:

