With rsync you can securely and efficiently transfer files, directories, and complete server content over SSH from one Linux server to another — no control panel required, directly from the command line.
Prerequisites: SSH access to both servers as root. rsync is pre-installed on most Linux distributions — if not: apt install rsync or yum install rsync.
| Flag | Purpose |
|---|---|
| -a | Archive mode — preserves permissions, ownership, symlinks, and timestamps |
| -v | Verbose — shows which files are being transferred |
| -z | Compress during transfer — saves bandwidth |
| --progress | Shows progress per file |
| --delete | Deletes files on the target that no longer exist on the source — for a clean sync |
| --exclude | Excludes directories or file patterns from the transfer |
Run this on the source server — replace the IP with the target server's address:
Review the output for unexpected files or errors before starting the real transfer.
Run the actual transfer — ideally inside a screen or tmux session so it continues if the SSH connection drops:
Do not stop active services on the source server during the transfer — active database files should be transferred separately via Database Migration.
systemctl start nginx, systemctl start mysql, etc.)