Linux : Copy files directly between two remote servers

Imagine you want to switch to a new dedicated server and your current website size is say 5 GB. It becomes really cumbersome to first download the entire website to your local PC and then upload it to your new server.

Thanks to Linux SCP command that you can directly copy files/folders between two servers (with SSH access, ofcourse)

This is the Linux scp command syntax to retrieve file or directory FROM a remote computer:

scp -r login name@ip-address :/path/filename .

the last period (.) tell the shell to copy the files to the current directory

This is the Linux scp command syntax to send file or directory TO a remote computer:

scp -r /path/filename login_name@ip-address : .

This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *