The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Server Restore

Discussion in 'General Discussion' started by sam25, Nov 23, 2004.

  1. sam25

    sam25 Registered

    Joined:
    Mar 11, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    Greetings,

    Due to primary hard dirve crash of the server, we move this crashed hard drive as a seconday and attached new hard drive as a primary and install new RH9 on it with cpanel/whm

    Now we want to restore all domains back from seconday hard drive, but don't have backup tar.gz files for domains so we can't restore them. we have only that old hard drive (as a seconday, which is accassabel) contain file & directories like var, home, etc and many others....

    Anybody help me to restore domains back without backup.tar.gz files ?

    Thanks,
    Sam
     
  2. djmerlyn

    djmerlyn Well-Known Member

    Joined:
    Aug 31, 2004
    Messages:
    203
    Likes Received:
    1
    Trophy Points:
    16
    Did you keep any backups? Was your new primary drive the old backup drive?

    I don't think it's going to be as easy as just copying things over from the old drive...if it is...the best bet would be to mirror the old drive to the new one and scrap your fresh install to use the old one

    Also, after you get the data you need off the bad drive, take it out and throw it away. You don't want that to cause other intermittent problems on your server~

    :confused:
     
    #2 djmerlyn, Nov 23, 2004
    Last edited: Nov 23, 2004
  3. vtofa

    vtofa Registered

    Joined:
    Dec 11, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Any luck

    I'm in a similar predicament.
    How did you get it back up and running?
    Thanks!
    Tim
     
  4. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    I think it should be a fresh install on the new drive with all the same software (in eg. os, cPanel, etc). Then move old crashed drive as secondary, and then copy all:

    /etc/resolv.conf
    /etc/passwd
    /etc/group
    /etc/shadow
    /etc/trusted
    /etc/named.conf
    /etc/ips
    /usr/local/apache/conf/httpd.conf
    /etc/proftpd.conf
    /etc/trueuserdomains
    /etc/my.cnf
    /etc/domainalias
    /etc/userdomains
    /etc/domainips
    /etc/wwwacct.conf

    Directories:
    /home
    /etc/vfilters
    /etc/proftpd
    /etc/valiases
    /usr/share/ssl
    /var/cpanel
    /var/spool/cron
    /var/named
    /usr/local/cpanel/3rdparty/mailman
    /var/lib/mysql

    Once this data has been copied to the new system run the following scripts:

    /scripts/initquotas
    /scripts/resetquotas
    /scripts/updateuserdomains

    Hope, this will help. Good luck!
    Thank you
     
  5. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    This is a group of commands that will dp what you are looking for:

    Posted at http://forums.ev1servers.net/showthread.php?s=&threadid=38797&highlight=restore

    Code:
    o your cpanel server got hacked or crashed? Lots of that going around these days. And if you didn't have cpanel backups of all your sites, then your only option is to copy from the old drive... heres the basics..
    
    commands to be executed from root shell preceded by #
    
    Order restore from rackshack.
    
    In trouble ticket specify to leave the old drive in
    
    Once the restore is done, SSH in to box..
    
    mount the old / partition as old (on RS boxes almost always /dev/hdb3)
    
    # mount /dev/hdb3 /old
    
    run chkrootkit to make sure you don't copy back infected files.. http://www.chkrootkit.org/
    
    now we can start copying back data from the old drive
    
    # rsync -vrplogDtH /old/usr/local/apache/conf /usr/local/apache
    # rsync -vrplogDtH /old/var/named /var
    # rsync -vrplogDtH /old/home/* /home
    # rsync -vrplogDtH /old/usr/local/cpanel /usr/local
    # rsync -vrplogDtH /old/var/lib/mysql /var/lib
    # rsync -vrplogDtH /old/var/cpanel /var
    # rsync -vrplogDtH /old/usr/share/ssl /usr/share
    # rsync -vrplogDtH /old/var/ssl /var
    # rsync -vrplogDtH /old/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
    # rsync -vrplogDtH /old/var/log/bandwidth /var/log
    # rsync -vrplogDtH /old/usr/local/frontpage /usr/local
    # rsync -vrplogDtH /old/var/spool/cron /var/spool
    # rsync -vrplogDtH /old/root/.my.cnf /root
    # rsync -vrplogDtH /old/etc/httpd/conf/httpd.conf /etc/httpd/conf
    # rsync -vrplogDtH /old/etc/sysconfig/network /etc/sysconfig
    
    then change to the old etc, and execute all on one line ...
    
    # cd /old/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
    
    well I hope I got everything... after you move all that stuff you will find yourself fixing up little things here and there....
    
    I recomend updating cpanel afterwards .. /scripts/upcp .. /scripts/updatenow .. /scripts/sysup .. /scripts/fixeverything
    
    update exim .. /scripts/exim4
    
    Once everything works.. make sure you don't get 0wn3d again...
    update apache .. /scripts/easyapache
    update kernel to latest (plenty of howto's on these forums)
    mount /tmp as noexec (and symlink /var/tmp to /tmp) 
     
Loading...

Share This Page