cPanel provide ready script to do the backup to create cpanel backup from ssh execute below command
- First, log in to SSH as the Root user.
- Next, enter the following command string on the command line interface:
/scripts/pkgacct username
A backup of your account will be created and stored in the current directory you are logged in.
Restoring a cPanel Backup via SSH
To restore a previously created backup of your cPanel account, just follow these steps:
- First, if you haven’t already, log in to SSH as the Root user.
- Navigate to the directory containing your backup file.
- Next, to restore your cPanel backup, enter the following command into the command line:/scripts/restorepkg backup-username-03-04.2023.tar.gz