Server to server file transfers

Sat, Feb 16, 2008

Server

Server to server file transfers

Server to server file transfers are relatively easy on a dedicated or virtual private server running Unix. I’ll quickly show you how to use the scp command which acts just about exactly the same as the cp command. It copies all files from a specified source path to a destination path on the remote server and uses via SSH.

Lets say that I wanted to transfer all the files and folders of a single domain on Plesk, inside the httpdocs folder to another Plesk server into the public html directory of another domain, I would first change directory to where the source files lie.

cd /var/www/vhosts/domain.com/httpdocs

Quickly check the current path that you are in.

pwd

Now execute the scp command together with the username of a user whom has shell access on the remote server. After the username, we append the path to which the source files will be copied to the destination server. You’ll also notice that I used -r which is the recursive option. It will recursively copy all files folders, subfolders, etc…

scp -r * root@domain.com:/var/www/vhosts/domain.com/httpdocs/

And that’s it! You’ll have all the specified source files copied from one server to another. I’m going to post another tutorial shortly on how to dump an entire MySQL database directly from one server into the database of another, remote server. Check the RSS feed if you are interested.

, , , , , , ,

This post was written by:

Antonie Potgieter - who has written 57 posts on Lost-In-Code.

I (Antonie Potgieter) am a software engineer/web developer located in South Africa. My full-time work is the management of Tribulant Software and the development of its software packages.

Contact the author

0 Comments For This Post

1 Trackbacks For This Post

  1. Surf Raporu, 28 Mart 2008 | Taylan Aktepe Says:

    [...] Server to server file transfer. Bağlantı… [...]

Leave a Reply