完整恢复(备份或克隆)cpanel

从一块硬盘完整恢复cpanel,或者从远程服务器完整恢复cpanel
平日接触LVM比较少,一时也没去注意到,期间走了很多弯路,还好有billy帮忙- –
挂载LVM卷,lvm命令好像很强大,但还没机会试试

  1. vgscan|grep -i volgroup #查找卷标
  2. vgchange --available y Your_VolGroup_Name
  3. mount /dev/Your_VolGroup_Name/ROOT /oldHD

完整备份cpanel,eukhost的这篇文章讲得很详细(底部的ssh-key是指从本机完整备份到远程服务器)

  1. mkdir /oldHD #创建被挂载目录
  2. mount /dev/sdb2 /oldHD #挂载
  3.  
  4. rsync -vrplogDtH /oldHD/usr/local/apache/conf /usr/local/apache
  5. rsync -vrplogDtH /oldHD/var/named /var
  6. rsync -vrplogDtH /oldHD/home/* /home
  7. rsync -vrplogDtH /oldHD/usr/local/cpanel /usr/local
  8. rsync -vrplogDtH /oldHD/var/lib/mysql /var/lib
  9. rsync -vrplogDtH /oldHD/var/cpanel /var
  10. rsync -vrplogDtH /oldHD/usr/share/ssl /usr/share
  11. rsync -vrplogDtH /oldHD/var/ssl /var
  12. rsync -vrplogDtH /oldHD/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
  13. rsync -vrplogDtH /oldHD/var/log/bandwidth /var/log
  14. rsync -vrplogDtH /oldHD/usr/local/frontpage /usr/local
  15. rsync -vrplogDtH /oldHD/var/spool/cron /var/spool
  16. rsync -vrplogDtH /oldHD/root/.my.cnf /root
  17. rsync -vrplogDtH /oldHD/etc/httpd/conf/httpd.conf /etc/httpd/conf
  18.  
  19. cd /oldHD/etc #进入旧硬盘的etc目录
  20. 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
  21.  
  22. /scripts/upcp
  23. /scripts/updatenow
  24. /scripts/sysup
  25. /scripts/exim4 #我的服务器上没有找到这exim4
  26. /scripts/easyapache
  27. /scripts/securetmp
  28. /scripts/fixeverything
  29. #做这个fixeverything操作前,iptables务必不要封锁cpanel的端口,ssh很有可能会起不来
  30.  
  31. /scripts/restartsrv httpd
  32. /scripts/restartsrv cpanel
  33. /scripts/restartsrv mysql
  34. /scripts/restartsrv named
  35. /scripts/restartsrv exim
  36.  
  37. 四个有用的lvm卷命令
  38. #1: lvdisplay
  39. #2: pvs
  40. #3: vgscan
  41. #4: vgchange
1 1