Here’s a clear and actionable guide for migrating cPanel accounts from your current VPS provider to a new one without using full cPanel backups, ideal for minimizing bandwidth and reducing downtime:
If you want to move all your accounts to a new VPS without transferring large home directory data through the cPanel full backup, you can follow this efficient method using the --skiphomedir
flag and rsync
.
β Step-by-Step Instructions
1. Generate cPanel Account Backup Without Home Directory
Run the following command on your current VPS:
/scripts/pkgacct --skiphomedir username
This command creates a partial backup of the cPanel account (excluding the /home/user
data), typically in:
/var/cpanel/users/username
Or look under:
/home/cpmove-username.tar.gz
2. Transfer Backup File to New Server
Copy the partial backup file from your current VPS to the new one using rsync
or scp
:
rsync -av /home/cpmove-username.tar.gz root@NEW-SERVER-IP:/home/
Or alternatively:
scp /home/cpmove-username.tar.gz root@NEW-SERVER-IP:/home/
3. Restore the Account on the New Server
On your new VPS, restore the account with:
/scripts/restorepkg username
This will recreate the account with all settings (databases, emails, DNS zones, cron jobs, etc.) but without the home directory files.
4. Sync User Home Directory Separately
Now sync the userβs home directory from the old server to the new one:
rsync -av --progress /home/username/ root@NEW-SERVER-IP:/home/username/
π Make sure SSH keys or credentials are correctly set up before using
rsync
.
π Repeat for All Accounts
Repeat steps 1β4 for each user you want to migrate.
π Notes
- This method is ideal when you want fast migration without heavy full backups.
- Ensure both servers have matching PHP versions, MySQL versions, and any other dependencies to avoid compatibility issues.