Transfer files between two servers with scp
When moving a website to a new server, this script comes in handy allowing you to transfer the files directly from one server to the other. This means you don’t have to download to your desktop or re-upload etc. Additionally, the data centres you host with will most likely have a better internet connection than you do, so they transfer quicker too.
Note: The command below will transfer a tar archive from one server to another, read this article if you need to know how to create the tar archive first.
scp file/to/transfer [email protected]:/path/to/destination
Run this while logged in to the original server, using the username and ip you use to ssh into the new server.