🔔 🔔 🔔 Duyuru: 24. Yılımıza özel indirimler sizleri bekliyor ! Kampanya Kodu : TDATA2024 | Detaylı bilgi için tıklayınız.

Restore cpanel server from corrupted drive


Restore cpanel server from corrupted drive


Restore cpanel server from corrupted drive. If your server drive got corrupted and need to restore data from it then you can use the following steps to restore data from problematic drive.

Rsync stands for remote sync. rsync is used to perform the backup operation in UNIX / Linux. rsync utility is used to synchronize the files and directories. We can use this to restore database from corrupt drive.

Ask your DC to attach corrupted drive as secondary drive and mount drive as olddrive 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/apache
rsync -vrplogDtH /olddrive/var/named /var
rsync -vrplogDtH /olddrive/home/* /home
rsync -vrplogDtH /olddrive/usr/local/cpanel /usr/local
rsync -vrplogDtH /olddrive/var/lib/mysql /var/lib
rsync -vrplogDtH /olddrive/var/cpanel /var
rsync -vrplogDtH /olddrive/usr/share/ssl /usr/share
rsync -vrplogDtH /olddrive/var/ssl /var
rsync -vrplogDtH /olddrive/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
rsync -vrplogDtH /olddrive/var/log/bandwidth /var/log
rsync -vrplogDtH /olddrive/usr/local/frontpage /usr/local
rsync -vrplogDtH /olddrive/var/spool/cron /var/spool
rsync -vrplogDtH /olddrive/root/.my.cnf /root
rsync -vrplogDtH /olddrive/etc/httpd/conf/httpd.conf /etc/httpd/conf

Copy all old drive /etc folder configuration files.

cd /olddrive/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

Updating scripts and restarting services:

/scripts/upcp
/scripts/updatenow
/scripts/easyapache
/scripts/securetmp
/scripts/fixeverything

Restarting services as:

/scripts/restartsrv httpd
/scripts/restartsrv cpanel
/scripts/restartsrv mysql
/scripts/restartsrv named
/scripts/restartsrv exim

Done… Thats all!!!

If you need to restore data to remote server then copy files to remote server. Enable SSH key authorized login without root password between both servers.

Go to old serve which is corrupted drive.

cd /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 root@84.23.43.45:/etc

(84.23.43.45 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 root@84.23.43.45:/usr/local/apache
rsync -vrplogDtH /var/named root@84.23.43.45:/var
rsync -vrplogDtH /home/* root@84.23.43.45:/home
rsync -vrplogDtH /usr/local/cpanel root@84.23.43.45:/usr/local
rsync -vrplogDtH /var/lib/mysql root@84.23.43.45:/var/lib
rsync -vrplogDtH /var/cpanel root@84.23.43.45:/var
rsync -vrplogDtH /usr/share/ssl root@84.23.43.45:/usr/share
rsync -vrplogDtH /var/ssl root@84.23.43.45:/var
rsync -vrplogDtH /usr/local/cpanel/3rdparty/mailman root@84.23.43.45:/usr/local/cpanel/3rdparty
rsync -vrplogDtH /var/log/bandwidth root@84.23.43.45:/var/log
rsync -vrplogDtH /usr/local/frontpage root@84.23.43.45:/usr/local
rsync -vrplogDtH /var/spool/cron root@84.23.43.45:/var/spool
rsync -vrplogDtH /root/.my.cnf root@84.23.43.45:/root
rsync -vrplogDtH /etc/httpd/conf/httpd.conf root@84.23.43.45:/etc/httpd/conf

Dont forget to change remote server ip address in configuration.

replace <soureip> to 84.23.43.45 — /var/named/*.db
replace <soureip> to 84.23.43.45 — /usr/local/apache/conf/httpd.conf

Then updating scripts and restarting services

Bu cevap yeterince yardımcı oldu mu?

Diğer Dökümanlar


  • What is cPanel and how to access it?

    CPanel is a fully featured web-based control panel that allows you to manage your domain through a web interface. cPanel gives you complete control over a vast amount of functions, streamlining...

  • CloudFlare Plugin install on cpanel

    CloudFlare is a performance and security service. With 14 points of presence around the world, a website on CloudFlare typically loads twice as fast, uses 65% less server resources, saves 60% of...

  • Enable Cronjob in cpanel and examples

    What is cron? It is the scheduling daemon of the Linux operating system Cron jobs allow you to automate repetitive tasks on the server that hosts your web site. This is a powerful tool that allows...

  • What is Anonymous FTP and how to enable it

    Anonymous FTP allows you and others that you give permission to, to access your “public_ftp” folder. There are two options available: 1. ftp://ftp.yourdomain.com –This allows...

  • Unable to connect cpanel using IP/whm and IP/cpanel

    If cpanel cannot be accessed using IP/whm and IP/cpanel, but can be accessed using IP:2086 and IP:2082, then here goes the solution for the same. The reason for this issue due to missing some...