How to Restore Files and Directories in WHM Print

  • whm, file restoration, backup, directory restoration, cpanel backup, server management, whm backup configuration
  • 0

WHM's File and Directory Restoration feature allows server administrators to restore individual files and folders from local backups for any cPanel account. This is useful when users accidentally delete files or need to recover previous versions of their website content. To use this feature, you must first enable backups in WHM's Backup Configuration interface.

Prerequisites for File Restoration in WHM

Before you can restore files and directories, you need to configure your server's backup system properly. In WHM, navigate to Home, then Backup, then Backup Configuration. You must enable account backups and configure retention settings to determine how many backup copies the system stores.

Several important limitations apply to this restoration method:

  • You can only restore from local backup files stored on your server. If your backups are stored remotely, you must first transfer them to the local server before restoration.
  • The system cannot restore .cpanel and mail directories through this interface. These require a full account restoration instead.
  • When you restore files, the system will overwrite any existing files with the same name and will restore previously deleted files.
  • Certain metadata settings can disable the File and Directory Restoration interface under specific conditions.

How to Access the File and Directory Restoration Interface

To begin restoring files for a cPanel account, log into WHM and navigate to the File and Directory Restoration interface. You'll see a list of all cPanel accounts on your server. Select the account that contains the files you want to restore and click View Backups.

The restoration interface contains two main sections. The Files and Directories section shows the file structure where backups exist, while the Backups section displays available backup copies with dates and timestamps. You can access backups using two methods: entering a direct path or browsing through the directory structure.

Restoring Files Using Direct Path Entry

The fastest way to restore a specific file or directory is by entering its direct path. This method works well when you know the exact location of the file you need to restore.

Follow these steps to restore using a direct path:

  1. In the Files and Directories section, select the Enter a path option.
  2. Enter the relative path from the cPanel account's home directory. For example, to restore a file in the public_html folder, simply type public_html followed by any subdirectories and the filename.
  3. Click Show Backups to display all available backup copies of that file or directory.
  4. In the Backups section, you'll see a list of backups organized by date. Select the backup version you want to restore.
  5. Click the Restore button next to your chosen backup.
  6. Confirm the restoration when prompted. The system will display a success or failure message once the process completes.

Important: When using the direct path method, the system will not show the contents of a directory. If you need to browse directory contents, use the browsing method instead.

Restoring Files by Browsing Directories

If you're unsure of the exact file path or want to explore available backups, you can browse through the directory structure instead of entering a direct path.

To restore files by browsing:

  1. In the Files and Directories section, select Browse files and directories.
  2. Navigate through the folder structure by clicking on directory names. The interface will show you all folders and files that have backup copies available.
  3. When you find the file or directory you want to restore, click on it to view available backups.
  4. The Backups section will populate with all backup versions of the selected item.
  5. Choose the backup date you want to restore and click Restore.
  6. Confirm your selection to complete the restoration process.

Managing Backup Retention Settings

The number of backup copies available for restoration depends on your retention configuration. OBHost servers allow you to customize how many backup versions the system keeps before automatically deleting older copies.

To adjust retention settings, access WHM's Backup Configuration interface and locate the Scheduling and Retention section. The Retention setting controls how many daily, weekly, or monthly backups your server maintains. Increasing this number provides more restoration points but requires more disk space for backup storage.

Understanding Backup Limitations

While the File and Directory Restoration interface is powerful, it has specific limitations you should understand. This tool only works with local backups, meaning if your backup destination is a remote server, you cannot restore directly from those locations. You must first download or transfer the remote backup files to your local server.

Additionally, certain system directories are excluded from individual file restoration. The .cpanel directory, which contains cPanel configuration data, and the mail directory, which stores email accounts and messages, cannot be restored through this interface. If you need to restore these directories, you must use WHM's full account restoration feature instead.

Troubleshooting Restoration Issues

If the File and Directory Restoration interface is not available or backups are not appearing, check your backup configuration settings first. Ensure that account backups are enabled and that the backup schedule is running successfully. You can verify this in WHM's Backup Configuration interface.

If you've recently changed metadata settings, these configurations may temporarily disable restoration features under certain conditions. Review your metadata settings and ensure they're configured to allow file restoration.

When restoration attempts fail, check the following common issues:

  • Verify that sufficient disk space is available on both the backup storage location and the destination directory.
  • Ensure the backup files are not corrupted by checking backup logs in WHM.
  • Confirm that file permissions allow the restoration process to write to the destination directory.
  • Check that the backup actually contains the file or directory you're trying to restore.

Why can't I see any backups for my cPanel account?

If no backups appear for a cPanel account, the most common reason is that backups are not enabled in WHM's Backup Configuration. Navigate to that interface and ensure you've enabled account backups and configured a backup schedule. If backups were recently enabled, you may need to wait for the first backup cycle to complete before any backup versions become available.

What happens to existing files when I restore from backup?

When you restore a file or directory, the system will overwrite any existing files with the same name at that location. This means the current version will be replaced with the backup version you selected. The system will also restore any files that were previously deleted. If you want to preserve the current version, consider downloading it or moving it to a different location before performing the restoration.

Can I restore email messages using this feature?

No, the File and Directory Restoration interface cannot restore the mail directory, which contains email accounts and messages. To restore email data, you must use WHM's full account restoration feature instead. This limitation exists because email restoration requires special handling to maintain mailbox integrity and proper email server configuration.

How can I restore files from a remote backup location?

The File and Directory Restoration interface only works with local backups stored on your server. To restore from remote backups, you first need to transfer the backup files from the remote location to your local server. Once the backup files are available locally, they will appear in the restoration interface and you can proceed with the normal restoration process.

If you need assistance with file restoration or backup configuration on your server, our support team is available 24/7 to help. Contact us at https://www.obhost.net/contact or email support@obhost.org for technical assistance.


Was this answer helpful?

« Back