Transferring files between servers is usually done with SCP or Rsync, two command-line tools that work via SSH. SCP is simple and suitable for one-time transfers, while Rsync is smarter: it only copies changes and can resume interrupted transfers. In this article, we explain when to use which tool, with concrete commands you can apply right away.
What are SCP and Rsync
SCP (Secure Copy Protocol) and Rsync are both command-line tools that let you copy files over an encrypted SSH connection between two servers or between your own computer and a server. Because both run over SSH, you need access to a server with SSH, a username, and usually a password or SSH key.
The main difference lies in how they operate. SCP simply copies files from A to B, without checking whether the file already exists or has been changed. Rsync compares the source and destination and only transfers the differences, which saves a lot of time and bandwidth with large amounts of data or repeated synchronizations.
Copying files with SCP
SCP works with a simple syntax: you specify the source, followed by the destination. A basic example to copy a file from your local computer to a server:
scp file.zip user@server-ip:/path/to/folder/
If you want to copy an entire folder, add the -r option for recursive copying:
scp -r /local/folder user@server-ip:/destination/folder/
To copy files directly between two remote servers, without the data passing through your own computer, use the -3 option:
scp -3 user1@server1:/path/file.zip user2@server2:/path/
SCP is convenient for small, one-time transfers, but has no resume capability. If the connection is interrupted, the transfer starts over from scratch.
Synchronizing files with Rsync
Rsync is more powerful and suitable for larger datasets or repeated synchronizations, for example when migrating a complete website. A basic command looks like this:
rsync -avz /local/folder/ user@server-ip:/destination/folder/
The options here each have a clear function: -a preserves file permissions and timestamps, -v shows progress (verbose), and -z compresses data during transfer, which is faster on a slow connection.
A useful addition is --progress, which shows progress per file, and --delete, which also removes files from the destination that are no longer in the source, keeping both folders identical.
rsync -avz --delete /local/folder/ user@server-ip:/destination/folder/
If an Rsync transfer is interrupted, you can simply run the command again: Rsync only copies what is still missing or has changed, instead of sending everything again.
SCP or Rsync: which one to choose
For a quick, one-time transfer of a single file, SCP is often sufficient and straightforward. If you’re moving larger amounts of data, transferring a backup, or periodically synchronizing files between servers, Rsync is the better choice due to its efficiency and repeatability.
Check SSH access
Make sure you can log in to both servers via SSH with a username and password or SSH key.
Choose the right tool
Use SCP for a single file or small folder, Rsync for large datasets or repeated synchronization.
Test with a small folder
First run the command on a test folder to check that the paths and permissions are correct.
Perform the full transfer
Start the actual copy process and check afterward that all files have arrived correctly.
If you’re migrating an entire website to a new hosting environment, it’s helpful to know in advance where your files will end up in Plesk. With Tandata, you can easily find the right folder structure in the Plesk file manager, so you can run your SCP or Rsync commands with the correct path. Also read more about switching to Tandata if you’re planning a full migration, or check out our knowledge base for more technical guides.
Frequently Asked Questions
Do I need root access for SCP or Rsync?
No, a regular SSH user with read permissions on the source and write permissions on the destination is sufficient. Root is only needed if you want to copy system files outside your own user folder.
Can I use Rsync without SSH?
Yes, Rsync can also work via its own daemon protocol, but for transfers between two separate servers, SSH is the safest and most commonly used method.
Why am I getting a permission denied error?
This usually indicates insufficient file permissions on the destination folder or an incorrectly logged-in user. Check the folder structure and permissions before running the command again.
Is Rsync faster than SCP?
For an initial full copy, both are roughly equally fast. For repeated transfers, Rsync is significantly faster because it only sends changes.
Can I also use SCP and Rsync for email files?
Yes, provided you have access to the correct mail folder on the server. For business email with proper configuration, check out business email.
Conclusion
SCP and Rsync are both reliable ways to securely copy files between servers via SSH. Use SCP for simple, one-time transfers and Rsync for larger or repeated synchronizations. With the right commands and a bit of practice on a test folder, you can avoid mistakes during a migration.