How to manually restore a cPanel account from JetBackup-generated backups

  WHM

Introduction

JetBackup allows administrators to create and manage backups for cPanel accounts. In situations where accounts need to be migrated to another server or restored manually, JetBackup-generated backups can be converted into the cPanel backup format and restored using the native cPanel restore utility.


Prerequisites

  • Root or SSH access to the cPanel server
  • Access to the JetBackup backup destination
  • JetBackup-generated backup files available
  • Sufficient disk space on the destination server

Implementation

Step 1: Download the Backup Snapshot Folder

Access your backup destination and download the backup snapshot folder to the cPanel server.

Path example:

/path/to/backup_folder/jetbackup_1_1_{UNIQUE_JOB_ID}/{USERNAME}/snap.2015-10-29.031006

Note:
The “snap” folders contain the actual backups, and the backup date is included in the folder name.

To verify that you are using the correct backup folder, ensure it contains the following directories:

  • homedir
  • mysql

Once the snapshot folder has been downloaded, log in to the cPanel server via SSH.


Step 2: Uncompress Databases (If Required)

If the option “Compress databases” on the backup process was enabled, uncompress the database files before proceeding.

cd {SNAP_FOLDER_PATH}/mysql

gzip -d {DATABASE_NAME}.sql.gz


Step 3: Create a cPanel Backup Archive

Create a tar archive of the backup contents using the cPanel backup naming format.

Make sure to replace USERNAME with the correct cPanel username.

tar -czvf ~/cpmove-{USERNAME}.tar.gz .


Step 4: Move the Backup File

Copy the generated backup archive to the cPanel server home directory and navigate to the home folder.

cd /home


Step 5: Restore the Account

Restore the account using the cPanel restore script.

scripts/restorepkg cpmove-{USERNAME}.tar.gz


Additional Note

If you are restoring from a full backup download generated by JetBackup, rename the downloaded archive file to the cPanel backup naming format before restoring.

Example:

cpmove-{USERNAME}.tar.gz

After renaming, proceed with Step 4 and Step 5.


Conclusion

By converting a JetBackup snapshot into the standard cPanel backup format, you can manually restore accounts on any compatible cPanel server. This method is particularly useful when migrating accounts between servers or recovering data from backup destinations.

LEAVE A COMMENT