1)After reinstalling cpanel, first confiigure WHM.
2)Mount old drives
3)Take backup of the following.
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 /olddrive/var/named/* /var/named/
check whether named is running and named.conf is updated.
Cool Apache restore
/scripts/rebuildhttpdconf >> /root/httpd
append /root/httpd to httpd.conf
copy the oldhome to the new home.
At this point domains will start working
10) restore mysql
copy the /oldvar/lib/mysql to /var/lib/mysql
copy the old proftpd /old/etc/proftpf
restore /etc/valiases and /etc/vfiilters
13)Restore the following
/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.
If the mysql does not start then check the error log at
tail -100 /var/lib/mysql/servername.com.err
Sometimes the permission of the mysql directories and files will not be correct. Correct that and everything will work fine.