Docs / Migration Guides / How to Clone a Server with rsync

How to Clone a Server with rsync

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

Cloning a server with rsync is a reliable way to replicate your Breeze configuration, files, and data to a new instance. It handles incremental transfers efficiently and preserves file permissions.

Prerequisites

  • SSH access to both source and destination Breeze instances
  • rsync installed on both servers (usually pre-installed)
  • Sufficient disk space on the destination

Basic Full Server Sync

Run this from the destination server, pulling from the source:

rsync -aHAXvz --progress \
  --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} \
  root@source-ip:/ /mnt/clone/

The flags explained:

  • -a archive mode (preserves permissions, ownership, timestamps)
  • -H preserves hard links
  • -A preserves ACLs
  • -X preserves extended attributes
  • -v verbose output
  • -z compression during transfer

Sync Specific Directories

To clone only web and database directories:

rsync -avz root@source-ip:/var/www/ /var/www/
rsync -avz root@source-ip:/var/lib/mysql/ /var/lib/mysql/

Incremental Updates

Run rsync again before the final switchover to catch recent changes:

rsync -aHAXvz --delete \
  --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*"} \
  root@source-ip:/ /

Post-Clone Steps

  • Update /etc/hostname and /etc/hosts with the new server identity
  • Regenerate SSH host keys: sudo dpkg-reconfigure openssh-server
  • Update network configuration for the new IP address
  • Reconfigure any services that bind to specific IPs

Was this article helpful?