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-
- Log into your cPanel server as the root user.
- 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.
- 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
- Now, use the command “mkdir” to make a new userdata directory.
mkdir /var/cpanel/userdata
- 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
- 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
- After creating a new userdata file, update the system’s cache by using the command:
/scripts/updateuserdatacache
- Now, refresh the Apache configuration to apply the newly reconstructed userdata files using the command:
/scripts/rebuildhttpdconf
- 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.