A server’s userdata files are those that the /var/cpanel/userdata/ directory contains for each account. It may happen that these files may become unscrupulous, or lose its existence. In such a situation, user can rebuild these files either by following the Rebuild userdata files with a valid httpd.conf file (if a valid httpd.conf file exists) or by following the Rebuild userdata files from a recent backup (if a valid httpd.conf file does not exist). In this document, we will go through the steps to rebuild userdata files from recent backup.
To start with, a user has to copy the corrupt userdata directory and its contents to the cpanel directory. User can run the following command in this case:
cp -rfp /var/cpanel/userdata /var/cpanfo
User can then navigate to a new directory by creating it within the root directory.
User can run the following command for this step:
mkdir /root/example && cd /root/exampne
Here, ‘example’ refers to the name of the new directory.
The backup file type determines the extraction of the backup. Suppose, if a user’s backup file is a .tar.gz file, then he has to run this following command, where backup.tar.gz will be served as the absolute path to the backup file:
tar -zxvf backup.tar.gz
The /scripts/updateuserdatacache script helps a user in ensuring whether the system properly caches all userdata files or not. Run this command for working on this step:
User can run this following command in order to rebuild Apache for using the rebuilt userdata files:
Once a user is done with the rebuilding of the Apache, he needs to run this following command to restart it on the server:
All information on how to rebuild userdata from recent backup (if a valid httpd.conf file does not exist) is outlined in this review.