cPanel stores account configuration in /var/cpanel/userdata. Rebuilding these files can recover missing or corrupt configuration when other recovery methods have failed. This is an administrator procedure affecting accounts across the server.
Use this procedure only after confirming userdata corruption. --reset recreates account configuration from Apache’s current configuration and does not preserve existing userdata customisations.
Confirm the recovery source
Log in as root, arrange a maintenance window and take a server recovery backup. Confirm that Apache’s existing httpd.conf is valid and contains the account configuration you need to recover.
/usr/local/apache/bin/apachectl -tA syntax check alone does not prove that all account entries are complete. If the file is missing, incomplete or invalid, use the cPanel backup-based recovery procedure with a suitable recent backup instead.
Rebuild from a valid Apache configuration
If /var/cpanel/userdata exists, preserve it first. Confirm that /var/cpanel/userdata.before-rebuild does not already exist before using the following destination:
mv /var/cpanel/userdata /var/cpanel/userdata.before-rebuildIf userdata was missing, omit the move. Create the new directory and regenerate the configuration:
mkdir /var/cpanel/userdata
/usr/local/cpanel/bin/userdata_update --reset
/usr/local/cpanel/bin/fix_userdata_perms
/scripts/updateuserdatacache
/scripts/rebuildhttpdconf
/usr/local/apache/bin/apachectl -tStop if a command fails. Only after the rebuilt Apache configuration passes validation, restart Apache:
/scripts/restartsrv_httpdVerify the accounts
Check representative sites, aliases, SSL configuration and account settings against the preserved data and backup. Retain the recovery copies until the server and any required customisations have been verified.