Hostxpeed
Login Get Started →
Server Management

How to Clone Your VPS

5 min read
22 views
Jun 10, 2026

Prerequisites

Before cloning your VPS, make sure you have:

  • SSH access to both source and destination VPS
  • Root or sudo privileges on both
  • Sufficient disk space on destination

Method 1: Using rsync (Files Only)

Connect to destination VPS:

ssh hxroot@DESTINATION_IP -p 22

Clone from source:

rsync -avz --exclude='/proc' --exclude='/sys' --exclude='/dev' --exclude='/tmp' --exclude='/mnt' --exclude='/media' --exclude='/run' hxroot@SOURCE_IP:/ /

⚠️ This command will overwrite destination files. Use with caution.

Method 2: Using tar Over SSH (Efficient)

From destination server:

ssh hxroot@SOURCE_IP "tar -czf - / --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/tmp --exclude=/mnt --exclude=/media --exclude=/run" | tar -xzvf - -C /

Method 3: Clone via Hostxpeed Portal (If Supported)

Some VPS providers offer cloning features:

  1. Create a snapshot of your VPS
  2. Deploy a new VPS from that snapshot
  3. Contact Hostxpeed support to check availability

After Cloning: Required Adjustments

Change hostname on cloned server:

sudo hostnamectl set-hostname new-hostname

Regenerate SSH host keys:

sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server

Update IP address in configuration files:

grep -r "OLD_IP" /etc/

Check and update database connection strings.

Clone Only Specific Directories (e.g., Website)

rsync -avz /var/www/html/ hxroot@DESTINATION_IP:/var/www/html/
mysqldump mydb | ssh hxroot@DESTINATION_IP mysql mydb

✅ VPS cloning completed. Test all services on the cloned server before using it in production.

Was this article helpful?