BuycPanel Blog

BuycPanel Blog

Latest news and updates

Steps to Rebuild ‘Userdata’ from Recent Backup

Posted by Allura on 03 07 2019.

Introduction
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.Rebuild Userdata Files From Recent Backup
Step 1: Copy The Corrupt Userdata Directory To A New Location
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/cpanfoStep 2: Create and navigate to a new directory in the root directory
User can then navigate to…

Introduction

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.

Rebuild Userdata Files From Recent Backup

Step 1: Copy The Corrupt Userdata Directory To A New Location

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

Step 2: Create and navigate to a new directory in the root directory

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.

Step 3: Extract the contents of your backup file to 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

Step 4: Run the updateuserdatacache script to update the system’s cache

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:

/scripts/updateuserdatacathi

Step 5: Rebuild Apache

User can run this following command in order to rebuild Apache for using the rebuilt userdata files:

/scripts/rebuildhttpdconf

Step 6: Restart Apache

Once a user is done with the rebuilding of the Apache, he needs to run this following command to restart it on the server:

/scripts/restartsrv_httpd

Conclusion

All information on how to rebuild userdata from recent backup (if a valid httpd.conf file does not exist) is outlined in this review.