Web host or web server powered by cPanel control panel has a very convenient feature to easily restore any backups in case of the need of disaster recovery, accidental lose of data or hosting account moving to another server. In cPanel, it’s possible to configure scheduled backup via WHM (WebHost Manager) which save all hosting accounts (unless excluded), MySQL databases and/or configuration files, or full backup of user own account which dumps to user’s root directory as a .tar.gz archive via cPanel interface.
What should you do with the full backup file in case when you really need to use it to restore an account or migrate a hosted website over from old hosting server?
To restore a full backup file, simply move the file (usually named as username.tar.gz or cpmove-username.tar.gz) to /home directory (or /usr/home, /web, /home2, /home3, /root, /usr directory if applicable). Then login to cPanel WHM (WebHost Manager), and click on Restore a Full Backup/cpmove file link under the Backup section. Enter the user name for the account to restore in the text field after “Enter the username for the account you wish to restore”. Finally click on Restore button and wait for the restoration process to complete.
Alternatively, administrator can also login to the server via SSH as root, and then run the following command in shell:
There is no need to create the account prior to restore as the account will be automatically created if it does not exist. All the user files and folders including databases will be restored to the correct locations. There is not need to untar or extract the backup file.