cPanel / WHM comes with a powerful backup and restore feature. Let’s learn how to use this feature via command-line / SSH.
Backing up a singular account is easy. Simply issue the following command to backup a cPanel account named ‘intellia’:
This particular script, ‘pkgacct‘ generates a ‘cpmove‘ .tar.gz file. This file will be stored in the home directory of your server, i.e:
Restoring an account with cPanel via SSH
Restoring an account from a ‘cpmove’ or auto-generated cPanel backup file is just as easy as backing one up.
To restore a ‘cpmove’ file, you will firstly need to make sure that the account is terminated:
Now, you can initiate a complete account restoration via the ‘restorepkg’ command:
Note: the ‘cpmove’ file will need to be moved to the /home/ directory in order to initiate the above command successfully.
The latter command can be used to restore a generic auto-generated cPanel backup file (this will overwrite existing files if the account already exists and is generally not recommended)
If you would like to backup all accounts on a cPanel / WHM server, simply issue the following command:
Feel free to ask any question you want. Quoting of your project is free.