1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help on moving cpanel accounts from damaged disk

Discussion in 'Data Protection' started by Alejandro P, Aug 29, 2010.

  1. Alejandro P

    Alejandro P Member

    Joined:
    Apr 6, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    I have a problem with system files on a cpanel server. the master disk is unbootable.

    the information seems to be intact, but will have to make an OS reload on a new master disk and

    then mount the old unbootable one with all the cpanel information as slave

    I have a lot of cpanel accounts on that server, but I don't know what would be the best way to restore the accounts on whm and put back to work

    I need your suggestions please :/
     
  2. Alejandro P

    Alejandro P Member

    Joined:
    Apr 6, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Would a rsync on important directories as /etc /var/named and /home put it back to normal?
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    12,231
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    Pennsylvania
    Do you have backups of the accounts? That's whats most important here. The system can be wiped and reloaded easy enough, its the accounts files you need most. The system files can be rebuilt/recreated/regenerated.
     
  4. Alejandro P

    Alejandro P Member

    Joined:
    Apr 6, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Hello, my backups are not to date. But there is no data lost from accounts on the original disk

    files deleted were located in /home/virtfs directory

    At this point a new hard drive has been mounted and the original one is mounted as slave, the data is complete but there are no restorable backups on it.

    that's why I suppose I could move the data to the new whm setup by rsync the files

    please let me know your suggestions

    Thanks
     
  5. GaryT

    GaryT Member

    Joined:
    May 19, 2010
    Messages:
    321
    Likes Received:
    0
    Trophy Points:
    16
    I had a similier issue a while back, Do you have another disc, Or another server, See the files are still accesable to you could transfer them over with the WHM transfer assuming that the disc is readable, Then you could clean the system / Partition thats gone wrong and put them back very easily with the WHM transfer without issues being caused.

    Or, the other thing you could try is, If the backups are set to /home you could try make this go to the default tmp partition at /backups, Then login the SSH and force the backup of the users, Then you can easily / rysnc / format the drive of /home and simply transfer them back.
     
    #5 GaryT, Aug 30, 2010
    Last edited: Aug 30, 2010
  6. Alejandro P

    Alejandro P Member

    Joined:
    Apr 6, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    This is a very good help I got from the nice Softlayer team

    As per our conversation if the Cpanel backups aren't an option, you can use the following commands:-
    -----------------------------------
    Manually moving Cpanel

    These commands will allow you to manually migrate all customer data and configs from an old primary drive installed as a slave

    * source drive should be mounted to /mnt/oldprimary
    * run chkrootkit to make sure you don't copy back infected files.. chkrootkit -- locally checks for signs of a rootkit

    now we can start copying back data from the old drive

    # rsync -vrplogDtH /mnt/oldprimary/usr/local/apache/conf /usr/local/apache
    # rsync -vrplogDtH /mnt/oldprimary/var/named /var
    # rsync -vrplogDtH /mnt/oldprimary/home/* /home
    # rsync -vrplogDtH /mnt/oldprimary/usr/local/cpanel /usr/local
    # rsync -vrplogDtH /mnt/oldprimary/var/lib/mysql /var/lib
    # rsync -vrplogDtH /mnt/oldprimary/var/cpanel /var
    # rsync -vrplogDtH /mnt/oldprimary/usr/share/ssl /usr/share
    # rsync -vrplogDtH /mnt/oldprimary/var/ssl /var
    # rsync -vrplogDtH /mnt/oldprimary/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
    # rsync -vrplogDtH /mnt/oldprimary/var/log/bandwidth /var/log
    # rsync -vrplogDtH /mnt/oldprimary/usr/local/frontpage /usr/local
    # rsync -vrplogDtH /mnt/oldprimary/var/spool/cron /var/spool
    # rsync -vrplogDtH /mnt/oldprimary/root/.my.cnf /root
    # rsync -vrplogDtH /mnt/oldprimary/etc/httpd/conf/httpd.conf /etc/httpd/conf
    # rsync -vrplogDtH /mnt/oldprimary/etc/sysconfig/network /etc/sysconfig

    then change to the old etc, and execute all on one line ...

    # cd /mnt/oldprimary/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

    Update cpanel afterwards
    /scripts/upcp
    /scripts/updatenow
    /scripts/sysup
    /scripts/fixeverything

    it worked very nicely, and in matter of 4 - 5 hours server was running again. Though doing this using cpanel backups would have taken about 24 hours.

    I wonder why this is not an option to have faster server transfers, instead of having to transfer accounts individually.
     
  7. beiruthost

    beiruthost New Member

    Joined:
    Jul 27, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    it seems commands needs update for version 11.30.5. some errors, and I can't see list of accounts and mysql fails
     
  8. cPanelMichael

    cPanelMichael Well-Known Member
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    17,858
    Likes Received:
    35
    Trophy Points:
    48
    Ideally, you should have account backups stored on an external server. Account backups include all of the necessary data related to the account, so they can be easily restored if an existing system fails. While some users have been able to manually restore cPanel and system related files, it's not supported and should only be attempted as a last ditch effort when no backups are available.

    Thank you.
     
  9. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    4
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    What are the specific errors? Simply stating "some errors" doesn't indicate the errors received.

    In the instance where backups do not exist and you will have zero data entirely unless you perform an rsync, you lose nothing by copying over the data via an rsync (in the instance where the drive is readable but in read only state). While rsync isn't recommended, you haven't much choice when no backups exist and a read only drive will not allow backups to be created.
     
  10. batchtech

    batchtech New Member

    Joined:
    Mar 13, 2004
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Please explain this. Are you saying that there is a way to create backups from the failed drive?

    Let's say my situation is the following:
    1. No backups available
    2. Old drive with all the data won't boot any more
    3. New hard drive is put in, OS reloaded and cpanel installed
    4. Old drive is mounted as slave

    Are you saying that I can create backups from the slave? If so, I would love to know how.

    I'm currently trying the rsync and have my fingers crossed. I'll update on the thread if I can gather any more information from it.

    Thanks!
     
  11. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    4
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    I actually state that you cannot create backups but can use rsync to copy over the data. This isn't creating a backup using the cPanel method, it is rsyncing data from the old drive to the new one.
     
  12. batchtech

    batchtech New Member

    Joined:
    Mar 13, 2004
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    FYI to anyone trying this solution, after running everything suggested by Alejandro, databases were great, emails seem to work fine, files and permissions in tact.

    The only thing I still had to do was rebuild apache due to an error I was getting when I restarted it. I rebuilt, then I could restart with no problems.

    This thread completely saved me from a disaster.
     
  13. batchtech

    batchtech New Member

    Joined:
    Mar 13, 2004
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Tristan, thanks for the clarification. I must have misunderstood you.
     
  14. pantherqs

    pantherqs New Member

    Joined:
    Aug 21, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I'm in almost the same boat here. Had a board faliure on a EOL server, drive is intact and mounted in the new box. The IP's and hardware is different. Anyone got any suggestions on how to go about doing that restore? Anything in particular that won't work with the steps outlined by Alejandro?
     
  15. pantherqs

    pantherqs New Member

    Joined:
    Aug 21, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Followed this and moved my site from one hardware setup to another with new ip's. Everything's up and running smoothly, just have to iron out some dns kinks.
     
  16. storminternet

    storminternet Member

    Joined:
    Nov 2, 2011
    Messages:
    431
    Likes Received:
    0
    Trophy Points:
    16
    rsync is fastest and reliable tool with which you can restore server.
     
  17. sansil

    sansil New Member

    Joined:
    Feb 24, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    hi,

    I lost all drive and soon after was able to retrieve data, could you tell me what I should rise above the / home?

    I raise only the / etc / passwd and shadow to the new hd with / around home?

    best regards
     

Share This Page