Announcement

Collapse
No announcement yet.

cPanel Crash Drive Recovery

Collapse
X
Collapse
  •  

  • cPanel Crash Drive Recovery

    Hi,

    I hope this topic will be helpful for all of you..

    You have a server whose disk is crashed for some reason and you have been provided with a new disk with OS and cPanel installed on it (SDA). The old drive is attached to the disk and this will be the second disk on the server (SDB)

    Check what partition contained the data through below command:

    Code:
    [FONT=georgia][SIZE=16px][FONT=comic sans ms][FONT=comic sans ms]# fdisk -l[/FONT][/FONT][/SIZE][/FONT]
    Once you find the partition, you can mount it to /old_drive
    Code:
    [FONT=comic sans ms][SIZE=16px]# mkdir /old_drive
    
    # mount /dev/hdb3 /old_drive[/SIZE][/FONT]
    Verify the home directory is present:
    Code:
    [FONT=comic sans ms][SIZE=16px]# ls /old_drive/home[/SIZE][/FONT]
    Begin the recovery using below commands:

    Code:
    [FONT=comic sans ms][SIZE=16px]# rsync -vrplogDtH /old_drive/usr/local/apache/conf /usr/local/apache
    
    # rsync -vrplogDtH /old_drive/var/named /var
    
    # rsync -vrplogDtH /old_drive/usr/local/cpanel /usr/local
    
    # rsync -vrplogDtH /old_drive/var/cpanel /var
    
    # rsync -vrplogDtH /old_drive/usr/share/ssl /usr/share
    
    # rsync -vrplogDtH /old_drive/var/ssl /var
    
    # rsync -vrplogDtH /old_drive/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
    
    # rsync -vrplogDtH /old_drive/var/log/bandwidth /var/log
    
    # rsync -vrplogDtH /old_drive/usr/local/frontpage /usr/local
    
    # rsync -vrplogDtH /old_drive/var/spool/cron /var/spool
    
    # rsync -vrplogDtH /old_drive/root/.my.cnf /root
    
    # rsync -vrplogDtH /old_drive/etc/httpd/conf/httpd.conf /etc/httpd/conf[/SIZE][/FONT]
    Make sure to copy the apache configuration files as per your built based on EA3 or EA4.. This is really important..

    Copy the MySQL data and then home data.. These are usually large in size, so my preferred choice is to do that in the last:

    Code:
    [FONT=comic sans ms][SIZE=16px]# rsync -vrplogDtH /old_drive/var/lib/mysql /var/lib
    
    # rsync -vrplogDtH /old_drive/home/* /home[/SIZE][/FONT]
    Now, here is the small but main part, i.e., copying the system configuration:
    Code:
    [FONT=comic sans ms][SIZE=16px]# cd /old_drive/etc
    
    # rsync -vrplogDtH secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl hosts /etc[/SIZE][/FONT]
    Change the root password immediately, as the password file is also been changed with the above command:
    Code:
    [FONT=comic sans ms][SIZE=16px]# passwd root[/SIZE][/FONT]
    Now, when all data is moved, you can update the cPanel built using below command:
    Code:
    [FONT=comic sans ms][SIZE=16px]# /scripts/upcp[/SIZE][/FONT]
    Recheck the EasyApache configuration and rebuild it too to match the modules and PHP versions..

    Once this is complete, the recovery is done. At this time, a reboot may not be required, but if there is any kernel update, please do install it and reboot the machine once.


    I hope that has been informative for you and I would like to thank you for viewing it.
    Last edited by Jayant R. Danech; 10-05-2018, 04:00 PM.
      Posting comments is disabled.

    Categories

    Collapse

    Latest Articles

    Collapse

    • What is Containerization? A Deep Dive into Containerization
      by Lalit_Waghulkar
      Hey there tech enthusiasts!

      Today, we're diving into the tech wonderland of containerization – a game-changer in the world of software development. So, buckle up your coding belts as we explore the ins and outs of this revolutionary technology and how it's turning the tables for developers everywhere.

      Containerization: What's the Buzz About?
      Alright, let's start with the basics. Containerization is like a digital lunchbox for your apps, keeping everything they need...
      01-10-2024, 03:08 PM
    • Enable native brute-force protection
      by Akash Gorane
      Error on Imunify 360 dashboard: Enable native brute-force protection module for Dovecot to protect against IMAP/POP3 services attacks.
      Screenshot: https://prnt.sc/ExqjW1hdfOrR

      Solution: Dovecot native brute force protection module improves stability and resolves issues that standard PAM caused in some cases The following commands can be used to control the Dovecot native module.

      Enable:
      :
      imunify360-agent config update '{"PAM": {"enable":
      ...
      02-03-2023, 06:12 PM
    • Enable native brute-force protection.
      by Akash Gorane
      Error on Imunify 360 dashboard: Enable native brute-force protection module for Dovecot to protect against IMAP/POP3 services attacks.
      Screenshot: https://prnt.sc/ExqjW1hdfOrR

      Solution: Dovecot native brute force protection module improves stability and resolves issues that standard PAM caused in some cases The following commands can be used to control the Dovecot native module.
      Enable:

      :
      imunify360-agent config update '{"PAM": {"enable":
      ...
      02-03-2023, 06:09 PM
    • Top Command
      by Akash Gorane
      [COLOR=rgba(0, 0, 0, 0.9)]'top' command is used to display dynamic real-time information about running processes in the system.[/COLOR]



      - PID: Shows task’s unique process id.
      - PR: Stands for priority of the task.
      - SHR: Represents the amount of shared memory used by a task.
      - VIRT: Total virtual memory used by the task.
      - USER: User name of owner of task.
      - %CPU: Represents the CPU usage.
      - TIME+: CPU Time, the same as ‘TIME’,
      ...
      01-12-2023, 05:12 PM
    • Top Command
      by Akash Gorane
      [COLOR=rgba(0, 0, 0, 0.9)]top command is used to display dynamic real-time information about running processes in the system.[/COLOR]



      - PID: Shows task’s unique process id.
      - PR: Stands for priority of the task.
      - SHR: Represents the amount of shared memory used by a task.
      - VIRT: Total virtual memory used by the task.
      - USER: User name of owner of task.
      - %CPU: Represents the CPU usage.
      - TIME+: CPU Time, the same as ‘TIME’,...
      01-12-2023, 05:05 PM
    • TOP Command
      by Akash Gorane
      #[COLOR=rgba(0, 0, 0, 0.9)] top command is used to display dynamic real-time information about running processes in the system.[/COLOR]

      -
      - PID: Shows task’s unique process id.
      - PR: Stands for priority of the task.
      - SHR: Represents the amount of shared memory used by a task.
      - VIRT: Total virtual memory used by the task.
      - USER: User name of owner of task.
      - %CPU: Represents the CPU usage.
      - TIME+: CPU Time, the same as ‘TIME’,
      ...
      01-12-2023, 05:04 PM
    Working...
    X