How to Rebuild Corrupted User Data Files in cPanel

December 12, 2023 / cPanel & WHM

In this article, we will explain how to rebuild corrupted user data files in cPanel.

To restore a corrupted user data file in cPanel, proceed with the following steps-

  1. Log into your cPanel server as the root user.
  2. Here, use the given code to find the user data files in the terminal.
    /var/cpanel

    Note:- Ensure that the userdata directory exists on the server.

  3. If the directory exists, use the “mv” command to move or rename it. It might appear like this:
    mv /var/cpanel/userdata /var/cpanel/userdata_backup
  4. Now, use the command “mkdir” to make a new userdata directory.
    mkdir /var/cpanel/userdata
  5. Now that a new userdata directory is created, to fix userdata files for all cPanel accounts, run the script “userdata_update” with the “–reset” flag. This rebuilds the userdata files for all hosted accounts on your cPanel server.
    /usr/local/cpanel/bin/userdata_update –reset
  6. After that, you need to adjust the permissions for the new user data files by using the command:
    /usr/local/cpanel/bin/fix_userdata_perms
  7. After creating a new userdata file, update the system’s cache by using the command:
    /scripts/updateuserdatacache
  8. Now, refresh the Apache configuration to apply the newly reconstructed userdata files using the command:
    /scripts/rebuildhttpdconf
  9. Finally, restart the Apache service using the command:
    /scripts/restartsrv_httpd

This is how you can rebuild corrupted user data files in cPanel.

For additional information about cPanel, check our knowledge base section.

Dominos Search