Announcement

Collapse
No announcement yet.

How to Rebuild userdata Files from backup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Rebuild userdata Files from backup

    Overview
    Warning: Do not perform the steps in this document unless you are certain that your server's user data files are corrupt or missing. You should only perform these steps as a last resort, when no other method will resolve the issue.

    In certain circumstances, your server's userdata files (the files that the /var/cpanel/userdata/ directory contains for each account) may become corrupt, or may be missing entirely. If this occurs, use the methods in this document to attempt to rebuild these files.

    The method that you use depends on whether a valid httpd.conf file exists on your server:

    A. If a valid httpd.conf file exists, follow the Rebuild userdata files with a valid httpd.conf file steps below.

    B. If a valid httpd.conf file does not exist, follow the Rebuild userdata files from a recent backup steps below.

    Note: The steps below assume that you have already logged in to your server via SSH as the root user.


    Rebuild userdata files

    Warning:
    These steps rebuild userdata files from a recent backup. If a valid httpd.conf file exists on your server, we strongly recommend that you rebuild from this file instead.

    1. Copy the corrupt userdata directory to a new location.
    If a userdata directory currently exists on your server, copy it and its contents to the cpanel directory.

    To do this, run the following command:

    cp -rfp /var/cpanel/userdata /var/cpanel

    2. Create and navigate to a new directory in the root directory.
    Create a new directory within the root directory, and navigate to it.

    To do this, run the following command, where example is the name of the new directory:

    mkdir /root/example && cd /root/example

    3. Extract the contents of your backup file to the new directory.
    The method that you use to extract the backup depends on the type of backup file.

    For example, if your backup file is a .tar.gz file, run the following command, where backup.tar.gz represents the absolute path to the backup file:

    tar -zxvf backup.tar.gz

    4. Run the updateuserdatacache script to update the system's cache.
    The /scripts/updateuserdatacache script ensures that the system properly caches all userdata files.

    To do this, run the following command:

    /scripts/updateuserdatacache

    5. Rebuild Apache.
    You must rebuild Apache to use the rebuilt userdata files.

    To do this, run the following command:

    /scripts/rebuildhttpdconf

    6. Restart Apache.
    After you rebuild Apache, you must restart it on your server.

    To do this, run the following command:

    /scripts/restartsrv_httpd


    Regards,
    Dexter
    http://webhosting.uk.com
Working...
X