🧩 Restoring cPanel Accounts on a New Server (CloudLinux)

This guide shows how to restore cPanel accounts from a backup directory (e.g., /backup/2024-01-01/accounts/) on a new server running cPanel and CloudLinux.


📂 Prerequisites

  • Root SSH access to the new server
  • Backup directory exists: /backup/2024-01-01/accounts/
  • cPanel and CloudLinux are installed and licensed
  • Sufficient disk space and inode limits

✅ Step-by-Step Account Restore

🔹 1. Define Restore Parameters

RESTORE_FROM_DATE="2024-01-01"
BACKUP_TYPE="daily"

if [ "$BACKUP_TYPE" = "daily" ]; then
    BACKUP_BASE="/backup/$RESTORE_FROM_DATE/accounts/"
else
    BACKUP_BASE="/backup/$BACKUP_TYPE/$RESTORE_FROM_DATE/accounts/"
fi

🔹 2. Start Batch Restore

for CP_ACC in $(find "$BACKUP_BASE" -maxdepth 1 -type d | awk -F/ '{print $5}' | sed 's/.tar.gz//g'); do
    /usr/local/cpanel/bin/backup_restore_manager add user="$CP_ACC" restore_point="$RESTORE_FROM_DATE" mail_config=1 mysql=1 subdomains=1
done

✅ This uses the native backup_restore_manager tool for structured and reliable account recovery.


🔁 Manual Restore (For .tar.gz Archives)

If your backups are in .tar.gz format:

cd /backup/2024-01-01/accounts
for archive in *.tar.gz; do
    /scripts/restorepkg "$archive"
done

⚠️ Disk & Inode Considerations

For large accounts (e.g., examplefashionco – 50GB+, 500k+ inodes):

  • Use a dedicated VPS or cloud instance
  • Minimum 100GB SSD storage
  • High inode support
  • 2GB+ RAM recommended

🌐 Transferring Backups from the Old Server

Use rsync to copy from the old server:

rsync -avR --progress -e "ssh -p 5222" ./2024-01-01 [email protected]:/home

(Replace IP, port, and path with your actual server details.)


✅ Post-Restore Checklist

  • Confirm websites load correctly
  • Verify DNS zones
  • Test email delivery and settings
  • Check database connections
  • Fix file/folder ownerships if needed
  • Assign correct PHP version per user
Scroll to Top