How to Rebuild Corrupted User Data Files in cPanel Print

  • 44

Repairing Corrupted User Data Files

To rebuild a corrupted user data file within cPanel, follow these steps:

  1. First, log in to your WHM/cPanel server as the root user using your username and password.
     
  2. Next, you’ll need to locate the user data files, which can be found at /var/cpanel. Make sure the userdata directory is present on the server.
     
  3. If the directory does exist, move it or rename it with the mv command. It should look something like this:
     
    mv /var/cpanel/userdata /var/cpanel/userdata_backup
     
  4. Now, create a new userdata directory with the command mkdir:
     
    mkdir /var/cpanel/userdata
     
  5. Now that we have a new userdata directory created, in order to rebuild the userdata files for all the accounts hosted on your cPanel server, run the script userdata_update with the –reset flag. This will rebuild the userdata files for all accounts hosted on your cPanel server.
     
    /usr/local/cpanel/bin/userdata_update –reset
     
  6. Next, you’ll need to fix the permissions for the newly generated user data files which can be done by running the command:
     
    /usr/local/cpanel/bin/fix_userdata_perms
     
  7. Since you’ve generated a new userdata file, you will need to update the system’s cache. This can be done using the command:
     
    /scripts/updateuserdatacache
     
  8. Now, rebuild the apache configuration in order to use the newly rebuilt userdata files with the command:
     
    /scripts/rebuildhttpdconf
     
  9. Lastly, restart the apache service with the command:
     
    /scripts/restartsrv_httpd

Was this answer helpful?

« Back