cPanel by default comes with the inbuilt scripts, which has the ability to backup or restore your cPanel account. Following are the commands given to run these scripts.
Following is the command which creates the backup of a cPanel account.
/scripts/pkgacct
Following is the command which restores the taken backup
/scripts/restorepkg
Both these commands should be run as root and while restoring a backup you also need to take care to be in the same directory in which the backup is stored.