Answered by the Webhosting Experts

WHM/cPanel Backup Guide

Backups play a critical role in server management by preserving data and allowing quick restoration in case of failure, corruption, or accidental deletion. In web hosting, especially with WHM/cPanel environments, regularly configuring backups becomes essential to protect websites, databases, emails, and other crucial information.

cPanel simplifies the backup process with its built-in backup configuration feature. This tool lets administrators schedule automated backups, set retention periods, and select specific files, databases, or entire accounts for backup. As a result, it offers flexible backup management, tailored to the unique needs of each server. Moreover, administrators can easily choose storage locations, whether locally or via remote destinations such as FTP, Amazon S3, or Google Drive.

A reliable backup strategy is vital for disaster recovery and business continuity. With the right setup, you can quickly restore services after data loss, minimizing downtime and preventing data compromise. This WHM/cPanel Backup guide will go over the best backup practices, 3-2-1 backup rule, the ideal backup layout in your server, and backup configuration options within WHM/cPanel.

Best Backup Practices

When managing backups in WHM and in general, following best practices ensures data protection and smooth recovery in case of emergencies. By following these best practices, you ensure that your WHM backups and overall backup strategy provide strong protection against data loss and enable quick recovery in case of failure.

  1. Schedule Regular Backups: Regular backups are essential to safeguard your data. In WHM, configure automated daily, weekly, or monthly backups to keep your server data up to date. This reduces the risk of losing critical information due to unexpected events. Make sure the frequency aligns with your business needs to avoid large gaps between backups.
  2. Store Backups in Multiple Locations: Relying solely on local backups can be risky. Use WHM’s options to send backups to remote destinations like FTP, Amazon S3, or Google Drive. Storing backups both locally and remotely ensures that if one storage option fails, you still have a secure copy elsewhere
  3. Use Incremental Backups: WHM offers an incremental backup option, which only saves changes made since the last backup. This method saves storage space and speeds up the backup process. Incremental backups are ideal for large servers where full backups may take too long or consume too much space.
  4. Implement Retention Policies: Set up retention policies to keep a specific number of backup copies. This practice ensures that older backups are automatically deleted when they’re no longer needed, freeing up storage space and reducing costs. Be mindful of keeping enough backups to cover potential data loss scenarios.
  5. Monitor Backup Processes: Keep a close eye on your backup processes through WHM’s backup logs and notifications. Monitoring helps you identify issues such as failed backups or insufficient storage space. Addressing these issues promptly ensures your backups remain reliable.

3-2-1 Backup Rule

The 3-2-1 backup rule is a widely recommended strategy for ensuring data protection and recovery. Following the 3-2-1 rule enhances data security and ensures that you can quickly recover your information in the event of data loss.

  1. Three Copies of Your Data: Keep at least three total copies of your data. This includes the original data and two backups. Having multiple copies reduces the risk of data loss from hardware failures or corruption.
  2. Two Different Media Types: Store the backups on at least two different types of storage media. For example, you might use an external hard drive and a cloud storage service. This diversification helps protect against failures specific to one medium, such as a hard drive crash.
  3. One Offsite Backup: Keep at least one backup offsite to protect against local disasters such as fires, floods, or theft. This could be a cloud backup or a physical backup stored at a different location. Offsite backups ensure your data remains safe even in catastrophic scenarios.

Designing the Ideal Server Backup Layout

When designing the ideal server backup layout, it’s essential to consider how to organize backups across different partitions and types of drives. Proper partitioning and selecting the right storage media for your backups can significantly improve performance, reliability, and recovery times.

Partitioning for Backup Layout

  • Create a dedicated partition solely for storing backups. This ensures that backups do not interfere with the system’s primary operations or other partitions, preventing scenarios where filling up the root or home partitions could crash the system.
  • It’s best practice to keep the operating system, application data, and backup data on separate partitions. For example:
    • / for the operating system.
    • /var or /home for application and user data.
    • /backup (or another designated partition) for backups

Choosing the Right Storage Media

The type of drive you use for storing backups is critical in determining how fast you can back up and restore data, as well as the long-term reliability of the storage.

  • Hard Disk Drives (HDDs): Cost-effective and high-capacity, HDDs are suitable for local backups that don’t require rapid access. Use them for less frequent backups, such as weekly full backups, stored on a dedicated partition to avoid impacting system performance.
  • Solid-State Drives (SSDs): SSDs offer faster read/write speeds, making them ideal for critical backups that need quick recovery, like daily or incremental backups. Create a separate SSD partition to enhance access speed and reliability for frequently used backup data.

NVMe drives, while fast, are not ideal for backup storage due to their high cost per gigabyte and lower write endurance, leading to faster wear from frequent backups. Their speed is often unnecessary for backup tasks, where traditional HDDs or SATA SSDs suffice. Additionally, NVMe drives generate more heat and offer fewer cost-effective redundancy options.

WHM/cPanel Backup Configuration

The WHM/cPanel Backup Configuration feature simplifies automated backups, allowing users to schedule, customize, and store data locally or remotely for secure, reliable recovery. WHM backups involve all accounts and are server-wide while cPanel backups are backups within specific accounts. We will review both and provide procedures accordingly below.

WHM Backups (All Accounts/Server-Wide)

Backup Status & Type

  1. Access the feature by navigating to Home / Backup / Backup Configuration within WHM.
  2. Proceed to check the box for “Enable Backups”.
  3. Select a backup type. For starters it is good to go with the default “Compressed” option.
    1. Compressed: This option saves disk space by compressing the backup but takes longer to create. It’s ideal when storage space is limited and backup speed is not critical.
    2. Uncompressed: Backups take more space but are created faster. This option is useful when you need quicker backups and have enough storage space available
    3. Incremental: Only backs up changes since the last backup, saving both time and disk space. It’s the most efficient option for ongoing backups, especially in environments with frequent changes.

      WHM Backup Configuration - Backup Type
      WHM Backup Configuration – Backup Type

Available Disk Space Check & Timeout Values

  1. Check the “Check the Available Disk Space” option and set it to 10% so that if the available disk space is less than the amount that you specified, the system will not run the backup.
  2. Leave the values for “Maximum Destination Backup Timeout” and “Maximum Backup Restoration Timeout” untouched.
  3. The default scheduling and retention section value is of course to have “Daily Backup” checked along with all the days you wish to backup but that can be modified as needed along with adding a weekly or monthly backups if dailies are not a good fit. 

    WHM Backup Configuration - Timeouts and Retention Policy
    WHM Backup Configuration – Timeouts and Retention Policy

Files Settings

  1. “Back up User Accounts” should be checked with access logs and bandwidth Data” both checked. The option to “Back up Suspended Accounts” is also available but not checked by default.
  2. Ensure to have “Back up System Files” checked to support server restoration.

    WHM Backup Configuration - Files Settings
    WHM Backup Configuration – Files Settings

Databases 

  1. Select the “Databases” option works best for you, however, the default and most recommended is to select “Per Account Only”.
    1. Per Account Only: Use the “mysqldump” command to create backup files with the “.sql” file extension for each account.
    2. Entire Data Directory: Back up all files in the “/var/lib/mysql/” directory.
    3. Per Account and Entire Data Directory: Back up all files in the “/var/lib/mysql/” directory, and use the “mysqldump” command to create backup files with the “.sql” extension for each account.


      WHM Backup Configuration - Databases
      WHM Backup Configuration – Databases

Backup & Retention Directories

  1. Configure the backup path under the “Configure the Backup Directory” section to match the directory/mounting point of your designated backup location. For example, if my partition is mounted to the /backup directory, then /backup is what will go into that field. 
  2. Backup Staging Directory can be set to the same path as your regular backups, however, that can be changed if necessary based on your preference, partition layout, and storage conditions.
  3. Ensure to check the “Retain Backups in the Default Backup Directory” so that once backups are made and the system transfers the backups to another destination it will maintain the backups in the default directory. If you disable this option, the system will delete the backups after they move to another destination.
  4. By default, the “Mount Backup Drive as Needed” is unchecked but can be checked if you’re experiencing any issues with the mounting point not mounting properly. Note that this requires a separate drive or other mount point.

    WHM Backup Configuration - Backup Directory Settings
    WHM Backup Configuration – Backup Directory Settings

Additional Destinations

WHM Backups can be sent to another location off server if needed. This can be useful if you do not wish to store backups locally on the server. 

  1. Proceed to the “Additional Destinations” tab within “Home / Backup / Backup Configuration” at WHM. 
  2. There are multiple options for backing up the account externally as shown in the image below.

    WHM Backup Configuration - Other Destinations
    WHM Backup Configuration – Other Destinations
  3. Information about the different types of Remote Backup Destinations and how to configure them can be found in the official cPanel documentation as that is a live document that should be examined upon configuration of that section. 

cPanel Backups (Specific cPanel Accounts)

A cPanel account backup creates a complete copy of your website files, databases, and emails, ensuring easy recovery and data protection in case of issues. This section is more specific to clients accessing their cPanel accounts as they would not normally have access to the WHM section unless they are the owner of the server/have access to the root user.

  1. The cPanel backup section can be reached by entering your cPanel account and navigating to “Backup” under the “Files” section.

    cPanel Backup
    cPanel Backup
  2. Within the section you can download a zipped copy of your entire site or a part of your site that you can save to your computer. When you backup your website, you have an extra copy of your information in case something happens to your host. The following can be made as well within the feature.
    1. A full backup which will create an archive of all of your website’s files and configuration. You can use this file to move your account to another server or to keep a local copy of your files.
    2. Account backups by date as per available backups on server.
  3. Partial Backups are also available along with the ability to restore them. The available items are listed below for reference.
    1. Home Directory Backup.
    2. Database Backup.
    3. Email Forwarders.
    4. Email Filters.

      cPanel Backups - Partial Backups & Restoration
      cPanel Backups – Partial Backups & Restoration

Further Assistance

For any further assistance involving partitions and backup configuration in WHM, do not hesitate to reach out to the Hivelocity Support team via a chat, support ticket, or phone at 888-869-4678.

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: support@hivelocity.net. We are also available to you through our phone and live chat system 24/7/365.