How to take Cpanel Backup in rescue mode

How to take Cpanel Backup in rescue mode

NOTE:  

In this guide, the server is in rescue mode with Debian OS and the actual server was in Centos 6.8. There are two scenarios, 1.Rescue mode (debian os) 2.Chroot (centos 6.8 under /mnt)

In this scenario the “/ ” and all other partitions (like /home) are under same drive, you have to mount the drives according to your server partition 

This method will not work on Centos 7 and later versions because the systemctl command will not work in chroot environment.

Rescue mode

  • Login to the rescue server using ssh or putty (ssh root@ip.add.re.ss)
  • Check  the (attached) old disk  with lsblk command and mount it on /mnt
#lsblk

for example if the disk name is /dev/sdb1
#mount /dev/sdb1 /mnt

  • Now the old disk has been mounted on /mnt
  • Check /mnt/dev /mnt/sys /mnt/proc directories under /mnt, it should be empty (the “/mnt/dev” will have null file)
  • Bind the directories from rescue server to /mnt environment as follows
# mount --bind /proc /mnt/proc
# mount --rbind /dev /mnt/dev
# mount --bind /sys /mnt/sys 

Chroot environment

  • Create screen with screen command

#screen -S chroot

  • From the screen chroot into “/mnt” with following command
#chroot /mnt

 

  • Now, you are connected with the old disk, you could see the actual server’s disk or list the files with ls -al command to verify the disk.
#cat /etc/redhat-release
CentOS release 6.8

 

  • Start the services like cpanel and mysql
#service cpanel start
#service mysql start

 

  • After starting the services, you can take backup with “/scripts/pkgacct” or “/usr/local/cpanel/bin/backup” or “/scripts/cpbackup”
  • Take the list of Cpanel users which you want to take backup and initiate with below script. The Cpanel usernames will be in “/etc/userdomains” file so, now we are going to get the list.
#cat /etc/userdomains | cut -d":" -f2 | sort -n | uniq >> users.txt

 

  • Open the file “users.txt” check if there is any blank spaces and use below command to remove blank spaces
#sed "s/ //g" users.txt

 

#for i in `cat users.txt`; do /scripts/pkgacct $i; done

 

  • The backup should be in progress
  • Detach the screen with Ctrl + ad
Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage   I am back with another blog to provide the useful script to the Freebsd users to determine the zpool

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support