In certain circumstances, your servers user data files may corrupt which can create issues while migrating, operating the cpanel accounts. These user data files can be repaired using a valid and working httpd.conf file on the server.
Let's assume we have a corrupted user data file, in order to rebuild the user data file follow the steps as below.
Login to your WHM/Cpanel server with root user
The user data files are located at /var/cpanel. Make sure if the userdata directory is present on the server.
If the directory exists , move it or rename it with mv command
mv /var/cpanel/userdata /var/cpanel/userdata_backup
Create a new user data directory with the command mkdir
- Now that we have a new userdata directory created , in order to rebuild userdata files for all the accounts hosted on your cpanel server run the script “userdata_update” with “--reset” flag which will rebuild the userdata files for all the accounts that are hosted on your cpanel server.
The next step will be to fix the permissions for newly generated user data files which can be done by running the command
Since we have a new userdata file generated we will need to update the system’s cache which can be done by command
- Now rebuild the apache configuration in order to use the newly rebuilt userdata files with the command