Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Member
    Join Date
    Jul 2004
    Posts
    22

    Unhappy Urgent Resyncing problem

    Hey,

    On the cpanel how to forum on ev1, theres one for restoring accounts from a damaged drive if its mounted as /old/.

    It says:
    Restoring Cpanel from old drive after crash or hack

    --------------------------------------------------------------------------------

    So 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)
    What would happen, if you already have accounts on the main HDD that dont have backups. Are they deleted? or left alone?

    Right now, I have 3 accounts on the main HDD. This is because the HDD mounted as /old/ as taken out from another server of mine and mounted onto this server (Dont ask why as I didnt ask for it to be so) but anyway, these accounts were already created.

    Im worried Im going to be removing these accounts if I resync like it says to above.

    Can someone let me know asap?

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    It will efectively wipe out any accounts that you already have. The only realistic way of restoring would be from cPanel backups in that case, not from a disk to disk transfer. One way around the issue would be to backup the "live" accounts. Then delete them all in cPanel. Then do the data migration. Then restore the backup accounts.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Jul 2004
    Posts
    22

    Default Re

    Thanks

    The main account on the main HDD is the one set with the nameservers for the server. Would this affect the server in any way? Will i need to reset all the nameserver settings once Ive restored the backup?

    Also, just to make sure as I cant afford problems, I understand there will be a few bugs to clean up after the transfers and so forth, but will those commands above work? and work with CentOS ?

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    The procedure works fine for CentOS. You should expect to lose anything that you currently have configured in WHM when you follow that procedure and will have to set them back up again if they're different from when the data was restored from.

    One thing to remember is that once done your root password will revert to what is was on the old OS disk. I would also recommend a reboot to esnure that everything comes back up as expected after you'd done all the work.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Member
    Join Date
    Jul 2004
    Posts
    22

    Default Re

    Thanks

    Although I now have another problem that I hope you can help me with. It wasnt there before so its only appeared within a few days perhaps hours. Nothing that I know of, has been done to the server since.

    When creating an account on the main HDD. (this being before any rsyncing). These errors appear.

    Code:
    [a fatal error or timeout occurred while processing this directive][a fatal error or timeout occurred while processing this directive]WWWAcct 10.0 (c) 1997-2005 cPanel, Inc.
    
       +===================================+
       | New Account Info                  |
       +===================================+
       | Domain: blah.xxxxxx.xxx
       | Ip: xx.xxx.xx.xxx (n)
       | HasCgi: y
       | UserName: blah
       | PassWord: sdfsdf
       | CpanelMod: x
       | HomeRoot: /home
       | Quota: unlimited Meg
       | NameServer1: ns1.xxxxxxx.xxx
       | NameServer2: ns2.xxxxxxx.xxx
       | NameServer3: ns3.xxxxxxx.xxx
       | NameServer4: 
       | Contact Email: 
       +===================================+
    User blah added
    Changing password for blah
    Password for blah has been changed
    Removing Shell Access (n)
    Changing shell for blah.
    Shell changed.
    Copying skel files from /root/cpanel3-skel/ to /home/blah/
    [an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive]Added Entries to httpd.conf
    Bind reconfiguring on server using rndc
    Added Named File
    Using Frontpage 5.x!
    No Server found   
    
    Restarting apache
    Ftp Password Files synced
    Vhost Passwords synced
    wwwacct creation finished
    Account Creation Complete!!!

  6. #6
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    /scripts/upcp --force

    should fix that.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  7. #7
    Member
    Join Date
    Jul 2004
    Posts
    22

    Smile Re

    Thanks, worked.

    If i have anything else, I know who to turn to

  8. #8
    Member
    Join Date
    Jul 2004
    Posts
    22

    Question Re

    I got this error when doing this command..

    # rsync -vrplogDtH /old/usr/local/cpanel /usr/local

    The error:
    rsync error: some files could not be transferred (code 23) at main.c (620)

    Alot of files and folders were copied, but just checking as I did get this error after it completed. Any idea whether this is just normal? maybe due to cpanel versions being different. I Dont know?

  9. #9
    Member
    Join Date
    Jul 2004
    Posts
    22

    Default Re

    Also get .. when i run this command
    rsync -vrplogDtH /old/var/ssl /var

    link_stat /old/var/ssl: no such file or directory

    Also get.. when i run this command
    rsync -vrplogDtH /old/root/.my.cnf /root

    link_stat /old/root/.my.cnf : no such file or directory

    and... for command:
    rsync -vrplogDtH /old/etc/httpd/conf/httpd.conf /etc/httpd/conf

    link_stat /old/etc/httpd/conf/httpd.conf : no such file or directory

    and for the command:
    rsync -vrplogDtH /old/etc/sysconfig/network /etc/sysconfig

    link_stat /old/etc/sysconfig/network : no such file or directory
    Last edited by GloVine; 08-22-2005 at 07:22 AM.

  10. #10
    Member
    Join Date
    Jul 2004
    Posts
    22

    Default Major problem

    More Bad news..

    When i try and run..

    # 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


    All of them come back as no such file or directory


    The server is of course, buggy now. No idea what to do

  11. #11
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Did you actually mount the old OS disk as /old ?
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  12. #12
    Member
    Join Date
    Jul 2004
    Posts
    22

    Default Re

    the drive was already mounted as old by the datecenter

  13. #13
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    If you:

    cd /old
    ls -la


    Do you see a load of directories including:

    /etc
    /usr
    /var
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  14. #14
    Member
    Join Date
    Jul 2004
    Posts
    22

    Default Re

    Yep, all of them are there

  15. #15
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    It's possible that I may not be a problem, but it's difficult to know without seeing the state of the disk. I've sent you a PM.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. URGENT!!! Problem @ Backup
    By berkgun in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 05-16-2006, 07:20 PM
  2. Weird problem, urgent help needed with Mail problem
    By fuzioneer in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-07-2005, 04:00 AM
  3. URGENT! - Major problem
    By phantom in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 07-12-2003, 09:52 PM
  4. Urgent Problem
    By Myacen in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-24-2002, 01:43 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube