Docs / Migration Guides / How to Transfer Files Between Servers with rsync

How to Transfer Files Between Servers with rsync

By Admin · Mar 2, 2026 · Updated Apr 23, 2026 · 26 views · 3 min read

How to Transfer Files Between Servers with rsync

When migrating data to a new Breeze instance, rsync is the gold standard for file transfers. Unlike basic scp, rsync only transfers changed portions of files, supports resumable transfers, and preserves file permissions, timestamps, and symbolic links.

Why rsync Over scp

  • Incremental transfers — only sends the differences between source and destination files
  • Resumable — if a transfer is interrupted, simply re-run the same command to pick up where it left off
  • Bandwidth control — limit transfer speed to avoid saturating your network
  • Permission preservation — keeps ownership, permissions, and timestamps intact
  • Exclusion patterns — skip cache directories, log files, and other unwanted content

Basic rsync Syntax

The basic syntax for transferring files from a source server to your Breeze:

rsync -avz --progress user@source-ip:/path/to/source/ /path/to/destination/

The flags break down as follows:

  • -a — archive mode, preserves permissions, ownership, timestamps, and symlinks
  • -v — verbose output so you can monitor progress
  • -z — compress data during transfer to save bandwidth
  • --progress — show per-file transfer progress

Transferring a Web Application

To migrate an entire web application to your Breeze while excluding unnecessary files:

rsync -avz --progress \
  --exclude='node_modules/' \
  --exclude='.git/' \
  --exclude='*.log' \
  --exclude='cache/' \
  --exclude='tmp/' \
  user@source-ip:/var/www/myapp/ /var/www/myapp/

The trailing slash on the source path is important. Including it copies the contents of the directory. Omitting it copies the directory itself into the destination.

Limiting Bandwidth

If you need to throttle the transfer so it does not impact production traffic on the source server:

rsync -avz --bwlimit=5000 user@source-ip:/data/ /data/

The --bwlimit value is in kilobytes per second. The example above caps the transfer at roughly 5 MB/s.

Using a Non-Standard SSH Port

If your source server runs SSH on a custom port:

rsync -avz -e 'ssh -p 2222' user@source-ip:/var/www/ /var/www/

Dry Run Before the Real Transfer

Always perform a dry run first to see what would be transferred without actually moving any data:

rsync -avz --dry-run user@source-ip:/var/www/ /var/www/

Review the output carefully. If it looks correct, remove the --dry-run flag and execute the real transfer.

Synchronizing with Delete

If you want the destination to be an exact mirror, removing files that no longer exist on the source:

rsync -avz --delete user@source-ip:/var/www/ /var/www/

Use --delete with caution. Combine it with --dry-run first to verify nothing important gets removed.

Verifying the Transfer

After the transfer completes, run rsync again. If no files are listed, the destination is fully in sync:

rsync -avz --dry-run user@source-ip:/var/www/ /var/www/

You can also compare file counts and directory sizes between the source and your Breeze to double-check:

find /var/www/ -type f | wc -l
du -sh /var/www/

Was this article helpful?