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

asmithjr

Well-Known Member
Jun 13, 2003
516
8
168
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.
 
Last edited:

asmithjr

Well-Known Member
Jun 13, 2003
516
8
168
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="[email protected]$1"
EMAIL="[email protected]"
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
 

mtindor

Well-Known Member
Sep 14, 2004
1,430
91
178
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


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="[email protected]$1"
EMAIL="[email protected]"
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
 

asmithjr

Well-Known Member
Jun 13, 2003
516
8
168
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.