1)After reinstalling cpanel, first confiigure WHM.
2)Mount old drives
3)Take backup of the following.
/var/cpanel
/etc/passwd
/etc/shadow
/etc/group
/var/named
cp -rpf /var/cpanel /var/cpanel.bak
cp -rpf /etc/passwd /etc/passwd.bak
cp -rpf /etc/shadow /etc/shadow.bak
cp -rpf /etc/group /etc/group.bak
cp -rpf /var/named /var/named.bak
4)First restore /var/cpanel
cp -rpf /oldvar/cpanel/* /var/cpanel
5)Please take little care while doing this step
Take the backup of old /etc/passwd, /etc/shadow, /etc/group
Edit backup of old etc/passwd.
Remove the Entires which are currentlly present in new /etc/passwd
Save the file. cat /olddrive/etc/passwd.bkp >>/etc/passwd
do the same for shadow and group
Note:After doing the above step please make sure that you are able to login to server.
6) run /scripts/updateuserdomains
This will restore /etc/userdomains
7) Named restore
Restore named from the olddrive
cp -rpf /oldvar/named/* /var/named/
run /scripts/rebuildnamedconf
/scripts/fixndc
check whether named is running and named.conf is updated.
Cool Apache restore
/scripts/rebuildhttpdconf >> /root/httpd
append /root/httpd to httpd.conf
restart httpd
9)Restore Home
copy the oldhome to the new home.
cp -rpf /oldhome/* /home/
At this point domains will start working
Smile
10) restore mysql
copy the /oldvar/lib/mysql to /var/lib/mysql
cp -rpf /var/lib/mysql /var/lib/mysql.bak
cp -rpf /oldvar/lib/mysql /var/lib/
11) FTP
copy the old proftpd /old/etc/proftpf
12)Mail
restore /etc/valiases and /etc/vfiilters
13)Restore the following
/etc/localdomains , /etc/ips, /etc/quota.conf, /etc/ssl, /etc/domainaliases, /etc/remotedomains /etc/reservedips, /usr/share/ssl, /var/log/bandwidth, /var/spool/cron , /usr/local/cpanel/3rdparty/mailman.
14, Restore pgsql if any
cp -rpf /usr/local/pgsql/data/*
15, Install Tomcat (if needed), copy over the tomcat config files:
Install Servlets (Optional)
ln -s /usr/local/jakarta/build-directory/ /tomcat
Copy from backupserver to newserver: /tomcat/conf/server.xml
Copy from backupserver to newserver: /tomcat/conf/server.xml.in
Copy from backupserver to newserver: /aiv-scripts/*
cp -rpf /oldvar/lib/mysql /var/lib/
cp -rpf /oldslash/etc/proftpd/* /etc/proftpd/
cp -rpf /oldslash/etc/valiases/* /etc/valiases/
cp -rpf /oldslash/etc/vfilters/* /etc/vfilters/
cp -rpf /oldslash/etc/ips /etc/ips
cp -rpf /oldslash/etc/quota.conf /etc/quota.conf
cp -rpf /oldslash/etc/localdomains /etc/localdomains
cp -rpf /oldslash/etc/remotedomains /etc/remotedomains
cp -rpf /oldslash/etc/reservedips /etc/reservedips
cp -rpf /oldusr/share/ssl /usr/share/
cp -rpf /oldvar/log/bandwidth/*Â /var/log/bandwidth/
cp -rpf /oldvar/spool/cron/* /var/spool/cron/
cp -rpf /oldusr/local/cpanel/3rdparty/mailman/* /usr/local/cpanel/3rdparty/mailman/