This article discusses steps you can use to recover a mailbox from a cPanel full backup, either when your email account has corrupt or missing data, or when moving to a different host.
The process of recovering single or multiple email accounts from a full cPanel backup involves extracting the compressed file, and then locating and copying the missing mail data. If the email account is also missing, create it first, and then copy the data from the backup.
Generally, a full backup contains all the domain files, including applications, email, databases, and others which you may not wish to copy to a new server.
Locate or Create a cPanel Full Backup
In most cases, the backup file will be in the root folder, or, as a download on a local drive. To access your backup file.
- Login to your domain cPanel account using the URL in the format:
- Enter your cPanel username and password.
- Navigate to Files and open the File Manager.
- Look for the full cPanel backup file in the home folder or local drive. This is usually a large file in Megabytes (MBs) or Gigabytes (GBs) depending on the size of your website. It has an extension .tar.gz and in the format - backup-date_time_cpanelusername.tar.gz
- If you have a backup file, proceed to step 2. If not, follow the instructions below to create one.
Create a cPanel Full Backup
If you are moving your email to a new host, you can create the full backup using the cPanel inbuilt backup tool. This allows you to perform selective or full backup or restore.
- Navigate to the Files in cPanel and open the Backup or Backup Wizard.
In our case, we will work with the Backup option.
- Click on the Backup and select the Download Full Website Backup option.
- Select the location to store the backup. The default is the Home Directory, but you can also select a Remote FTP Server location on another server, especially if you are migrating to a new host.
- Add an email if you want the system will send you a notification once the backup is complete. If you do not want the notification, select Do not send email notification of backup completion.
- Click Generate Backup
Once complete, you can download the backup from the links on the backup page. Each file has the date and time of backup details in its filename.
Alternatively, you can browse to your home directory and locate the file. If you moving to a different server, you can either move it there using FTP, or download to a local computer, extract the email files, and upload to the new server.
Decompress the cPanel Full Backup File
- Locate the backup file on your server or computer.
- Copy the backup file to a new folder
If you want to restore emails on the same server or a different server, do not extract the files in the root folder to avoid overwriting others.
- Create a new folder using the cPanel file manager.
- Select the file and click copy
- Type the name of the new folder where you want to store and extract the file.
Alternatively, download the file to your local drive and extract it there. This may take time depending on the size of the backup file and your internet connection speed.
- Go to the folder with the backup file.
- Right-click the file, choose extract or click the Extract at the toolbar at the top.
If on a computer use WinRAR or 7zip in Windows, or inbuilt tar tools in Linux to extract the files onto your local machine.
- Access the decompressed archive. The first level folder will be the homedir and will have a Mail subdirectory which holds all the domain mailboxes, each with its email data.
The location of the email folder is usually in the format:
- user is the cPanel account username for the email address
- Yourdomainname.com is your registered domain and
- Mailaccountname is the unique name of your mailbox.
- Go to the Homedir directory
- Open the Mail folder. This opens up the folder and displays the domains on the hosting account.
- Open the domain folder where you want to recover your email accounts. This gives the email folders, each the same name as the username of corresponding email account. For example, if you want to restore the email account info@yourdomain_name.com , you will find folder Info.
If you are within the same server, you can just copy the email folder across to the folder with the lost email files. When restoring to a different server, you need to compress all the files in the folder to create a single file that you can easily download and upload.
If the email account that is missing data is still on the server go to step 4. If not, use the following steps to recreate a new email account and associated folders.
Recreating Email Account
If your email account is missing, or you are restoring the email data on a new server, you need to recreate it in the cPanel. This will automatically create the folder. To create the email account,
- Log in to cPanel
- Navigate to Email Accounts under Email.
- Click on Add Email Account
- Enter the email username or part preceding the @sign and ensure that you have the correct domain.
- Type and confirm the password, then click create the account.
- Choose the Send welcome email with mail client configuration instructions, so that the system can automatically send an email to the email address owner on how to configure the different clients.
Once you have the email account and mailbox, you can now copy the files from the backup to using the following procedure.
Restoring Data on the Same Server
- Highlight the email folder you want to recover and click copy. (Select all folders if recovering multiple email accounts)
- Type the destination folder for the email data and click Copy File(s) - this should be the folder for the domain whose email account is missing data and in the format: home/cpanelusername/mail/domainname
This restores all your messages up to the date and time you performed the backup. The users can now use their accounts and have access to all their older emails.
Copying Email Data to a Different Server
If you want to recover an email account on a different server, use the following procedure.
- Highlight the email folder you want to transfer to the new server and click Compress.
- Highlight the compressed file and click Download to save it to a local folder.
- Download the file to your computer and note its location.
- Go to the new server and open the location of the email account folder where you want to restore files. This will be in the form
- On the new server click Upload
On your local machine, select the file you downloaded from the backup and upload it to the domain folder in the mail directory.
(Please note that you can also use FTP to transfer the file to the new server. In this case, you may not need to download to the local machine (unless the backup is on a local drive) and can do a transfer from the old server to the new one.)
- Once the process is complete, go to the folder and select the uploaded file
- Click Extract
This extracts the files into the new email folder or that which is missing data, and you can now start accessing your emails. However, this will only give emails up to the date of the backup.
Data backups are critical components of a digital system, including servers, computers, phones and other electronic systems. It prevents loss of data while ensuring continuity and less downtime. Domain owners can use the inbuilt cPanel features to perform regular data backups and restores.
A full cPanel backup file contains all the domain files and data. If you only want to recover email, you will need to extract the full cPanel backup file, locate the email account files, and finally copy them to the incomplete mailbox.