📘Restore cPanel data from a Backup Server

This guide explains how to restore cPanel account data from a backup server to a new cPanel server.


🧪 Step 1: Generate Backups on Source Server

On the source cPanel server, force a full backup for all accounts:

/usr/local/cpanel/bin/backup --force

Backups are typically saved in:

/backup/

or a custom directory such as:

/home/username/daily

📤 Step 2: Transfer Backups to New Server

To copy all backup files from the source server’s folder (e.g., /home/username/daily) to the new server’s folder (e.g., /home/backup), use the rsync command:

rsync -avp --progress -e "ssh -p 2500" /home/username/daily/ root@NEW_SERVER_IP:/home/backup/

Replace:

  • 2500 with the correct SSH port (default is 22)
  • NEW_SERVER_IP with the IP address of the new server

Ensure SSH access between the servers is allowed and root login is permitted on the destination server.


📦 Step 3: Restore Accounts on New Server

SSH into the new server, then run:

ls /home/backup/

This lists all available .tar.gz cPanel backup files. Restore each account using:

/scripts/restorepkg /home/backup/username.tar.gz

Or restore all at once (loop through files):

for file in /home/backup/*.tar.gz; do
/scripts/restorepkg "$file"
done

✅ Optional: Verify Restores

Check if accounts were successfully restored:

ls /var/cpanel/users/

And confirm websites are loading and email/services are intact.

Scroll to Top