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.

restore after OS reload, Best method to restore after OS reload

Discussion in 'General Discussion' started by asmithjr, Oct 29, 2007.

  1. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    I am upgrading Hard Drives and have faile at every attempt to use the R1soft restore so option down to putting in new drive with a fresh OS reload.
    My question is whatis the best method to restore everything from my current 80GB drive. Server is running cpanel. I know I would not want /dev and /proc from the old drive.

    How would you restore using the origional primary drive as the secondary drive? the new srive is 250 vs
    the
    80 for the old drive and the partition sizes will all be larger.
     
    #1 asmithjr, Oct 29, 2007
    Last edited: Oct 29, 2007
  2. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    can I bump this to see if it gets a response?
     
  3. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    I found this script; looks promising:
    Code:
    #!/bin/sh
    # /////////////////////////////////////////
    # //      SG 09/2004 CPanel              //
    # //    CPanel transfer config script    //
    # /////////////////////////////////////////
    #
    # HOST = User + IP / Hostname to copy files TO.
    # All files copied from this server to the destinations server.
    # Use this iscript to transfer THIS server to a new server.
    HOST="root@$1"
    EMAIL="your@email.com"
    if [ "$1" == "" ]; then
    echo "Usage: $0 IP"
    echo "Example: $0 123.123.123.123"
    echo "Will remotely transfer all files from THIS server over to this server IP 123.123.123.123"
    exit 1
    fi
    echo "	WARNING - YOU ARE GOING TO COPY FILES FROM THIS SERVER TO $1"
    echo "  THIS WILL OVERWRITE THE FILES ON THE REMOTE HOST AT $1 !!"
    echo ""
    echo "	Is this correct? Enter y/n"
    read confirm
    if [ "$confirm" == "n" ]; then
    echo "	User aborted. Type y to transfer files."
    exit 1
    elif [ "$confirm" == "N" ]; then
    echo "  User aborted. Type y to transfer files."
    exit 1
    elif [ "$confirm" != "y" ]; then
    echo "	Sorry I don't know what you neeed, enter y or n"
    exit 1
    else
    # /etc User / IP's + passwd files
    rsync -avz -e ssh /etc/passwd $HOST:/etc/
    rsync -avz -e ssh /etc/shadow $HOST:/etc/
    rsync -avz -e ssh /etc/group $HOST:/etc/
    rsync -avz -e ssh /etc/wwwacct.conf $HOST:/etc/
    rsync -avz -e ssh /etc/quota.conf $HOST:/etc/
    rsync -avz -e ssh /etc/domainalias $HOST:/etc/
    rsync -avz -e ssh /etc/remotedomains $HOST:/etc/
    rsync -avz -e ssh /etc/reservedipreasons $HOST:/etc/
    rsync -avz -e ssh /etc/reservedips $HOST:/etc/
    rsync -avz -e ssh /etc/secondarymx $HOST:/etc/
    rsync -avz -e ssh /etc/localdomains $HOST:/etc/
    rsync -avz -e ssh /etc/userdomains $HOST:/etc/
    rsync -avz -e ssh /etc/valiases $HOST:/etc/
    rsync -avz -e ssh /etc/vfilters $HOST:/etc/
    rsync -avz -e ssh /etc/vmail $HOST:/etc/
    rsync -avz -e ssh /etc/tru* $HOST:/etc/
    rsync -avz -e ssh /etc/ips $HOST:/etc/
    rsync -avz -e ssh /etc/domainips $HOST:/etc/
    rsync -avz -e ssh /etc/services $HOST:/etc/
    # ftpd files
    rsync -avz -e ssh /etc/sysconfig/pure-ftpd $HOST:/etc/sysconfig/
    rsync -avz -e ssh /etc/pure-ftpd.conf $HOST:/etc/
    rsync -avz -e ssh /etc/pure-ftpd $HOST:/etc/
    rsync -avz -e ssh /etc/proftpd $HOST:/etc/
    rsync -avz -e ssh /etc/proftpd.* $HOST:/etc/
    # /var
    rsync -avz -e ssh /var/cpanel $HOST:/var/
    rsync -avz -e ssh /var/spool/cron $HOST:/var/spool/
    
    # /usr config - 3rdparty
    rsync -avz -e ssh /usr/share/ssl $HOST:/usr/share/
    rsync -avz -e ssh /usr/local/cpanel $HOST:/usr/local/
    
    # Apache
    rsync -avz -e ssh /usr/local/apache/conf $HOST:/usr/local/apache/
    rsync -avz -e ssh /usr/local/frontpage $HOST:/usr/local/
    
    # Mysql config
    rsync -avz -e ssh /root/.my.cnf $HOST:/root/
    rsync -avz -e ssh /etc/my.cnf $HOST:/etc/
    
    # Named
    rsync -avz -e ssh /var/named $HOST:/var/
    rsync -avz -e ssh /etc/named.conf $HOST:/etc/
    rsync -avz -e ssh /etc/rndc.conf $HOST:/etc/
    
    #User Files
    # Mysql
    rsync -avz -e ssh /var/lib/mysql $HOST:/var/lib/
    #rsync -avz -e ssh $HOST:/var/lib/pgsql $DIR/var/lib/
    
    for SITE in `ls /var/cpanel/users`
    do
    rsync -avz -e ssh /home/$SITE $HOST:/home/
    done
    date | mail -s "Restore completed for $HOST" $EMAIL
    fi
    
     
  4. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    Check this thread: http://forums.cpanel.net/showthread.php?t=35046&highlight=clone+server&page=2

    You may have taken your script from that thread - I just think the whole thread is useful.

    Mike


     
  5. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    yes I did take it from there.
    My situation is a little different, I am going to move from a 80GB to a 250GB drive and want to copy everything within the same server.
     
Loading...

Share This Page