Troubleshoot - by Hostrare
Restore cpanel server from the fixed drive. If your server drive got fixed and need to restore data from it then you can use the following actions to restore data from a problematic drive.
Rsync stands for remote sync. rsync is used to perform the backup operation in UNIX / Linux. rsync utility is applied to synchronize the folders and directories. We can use this to restore the database from a corrupt drive.
Ask your DC to attach the corrupted drive as a secondary drive and mount the drive as an old drive folder
mount /dev/sdc /olddrive
We can start copying backup data from the old drive
If possible, do this process through SCREEN.
rsync -vrplogDtH /olddrive/usr/local/apache/conf /usr/local/apachersync -vrplogDtH /olddrive/var/named /varrsync -vrplogDtH /olddrive/home/* /homersync -vrplogDtH /olddrive/usr/local/cpanel /usr/localrsync -vrplogDtH /olddrive/var/lib/mysql /var/librsync -vrplogDtH /olddrive/var/cpanel /varrsync -vrplogDtH /olddrive/usr/share/ssl /usr/sharersync -vrplogDtH /olddrive/var/ssl /varrsync -vrplogDtH /olddrive/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdpartyrsync -vrplogDtH /olddrive/var/log/bandwidth /var/logrsync -vrplogDtH /olddrive/usr/local/frontpage /usr/localrsync -vrplogDtH /olddrive/var/spool/cron /var/spoolrsync -vrplogDtH /olddrive/root/.my.cnf /rootrsync -vrplogDtH /olddrive/etc/httpd/conf/httpd.conf /etc/httpd/conf
Copy all old drive /etc folder configuration files.
cd /olddrive/etcrsync -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
Updating scripts and restarting services:
Restarting services as:
/scripts/restartsrv httpd/scripts/restartsrv cpanel/scripts/restartsrv mysql/scripts/restartsrv named/scripts/restartsrv exim
Done… Thats all!!!
If you want to restore data to a remote server then copy files to the remote server. Enable SSH key authorized login without root password between both servers.
Go to old serve which is damaged drive.
cd /etcrsync -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 firstname.lastname@example.org:/etc
(22.214.171.124 is assumed as the IP of the new server to which we are moving the data.)
Now we need to transfer everything else.
rsync -vrplogDtH /usr/local/apache/conf email@example.com:/usr/local/apachersync -vrplogDtH /var/named firstname.lastname@example.org:/varrsync -vrplogDtH /home/* email@example.com:/homersync -vrplogDtH /usr/local/cpanel firstname.lastname@example.org:/usr/localrsync -vrplogDtH /var/lib/mysql email@example.com:/var/librsync -vrplogDtH /var/cpanel firstname.lastname@example.org:/varrsync -vrplogDtH /usr/share/ssl email@example.com:/usr/sharersync -vrplogDtH /var/ssl firstname.lastname@example.org:/varrsync -vrplogDtH /usr/local/cpanel/3rdparty/mailman email@example.com:/usr/local/cpanel/3rdpartyrsync -vrplogDtH /var/log/bandwidth firstname.lastname@example.org:/var/logrsync -vrplogDtH /usr/local/frontpage email@example.com:/usr/localrsync -vrplogDtH /var/spool/cron firstname.lastname@example.org:/var/spoolrsync -vrplogDtH /root/.my.cnf email@example.com:/rootrsync -vrplogDtH /etc/httpd/conf/httpd.conf firstname.lastname@example.org:/etc/httpd/conf
Dont forget to change remote server ip address in configuration.
replace to 126.96.36.199 — /var/named/*.dbreplace to 188.8.131.52 — /usr/local/apache/conf/httpd.conf
Then updating scripts and restarting services…
Whether you are looking for a personal website hosting plan or a business website hosting plan, We are the perfect solution for you. Our powerful website hosting services will not only help you achieve your overall website goals, but will also provide you with the confidence you need in knowing that you are partnered with a reliable and secure website hosting platform.
Any hosting service you require, you can avail 50% Discount with new verified account. Chat with your Team Now