Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Help on moving cpanel accounts from damaged disk

  1. #1
    Registered Member
    Join Date
    Apr 2007
    Posts
    51
    cPanel/WHM Access Level

    Root Administrator

    Default Help on moving cpanel accounts from damaged disk

    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. #2
    Registered Member
    Join Date
    Apr 2007
    Posts
    51
    cPanel/WHM Access Level

    Root Administrator

    Default

    Would a rsync on important directories as /etc /var/named and /home put it back to normal?

  3. #3
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    11,408
    cPanel/WHM Access Level

    Root Administrator

    Lightbulb

    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. #4
    Registered Member
    Join Date
    Apr 2007
    Posts
    51
    cPanel/WHM Access Level

    Root Administrator

    Default

    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. #5
    Registered Member
    Join Date
    May 2010
    Posts
    321

    Default

    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.
    Last edited by GaryT; 08-30-2010 at 08:48 AM.

  6. #6
    Registered Member
    Join Date
    Apr 2007
    Posts
    51
    cPanel/WHM Access Level

    Root Administrator

    Default

    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. #7
    Registered Member beiruthost's Avatar
    Join Date
    Jul 2004
    Posts
    18

    Default Re: Help on moving cpanel accounts from damaged disk

    it seems commands needs update for version 11.30.5. some errors, and I can't see list of accounts and mysql fails

  8. #8
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    13,911
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Help on moving cpanel accounts from damaged disk

    Quote Originally Posted by beiruthost View Post
    it seems commands needs update for version 11.30.5. some errors, and I can't see list of accounts and mysql fails
    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.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services - Change Logs
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  9. #9
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Help on moving cpanel accounts from damaged disk

    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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  10. #10
    Registered Member
    Join Date
    Mar 2004
    Posts
    12

    Default Re: Help on moving cpanel accounts from damaged disk

    Quote Originally Posted by cPanelTristan View Post
    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.
    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. #11
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Help on moving cpanel accounts from damaged disk

    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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  12. #12
    Registered Member
    Join Date
    Mar 2004
    Posts
    12

    Default Re: Help on moving cpanel accounts from damaged disk

    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. #13
    Registered Member
    Join Date
    Mar 2004
    Posts
    12

    Default Re: Help on moving cpanel accounts from damaged disk

    Tristan, thanks for the clarification. I must have misunderstood you.

  14. #14
    Registered Member
    Join Date
    Aug 2004
    Posts
    10
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Help on moving cpanel accounts from damaged disk

    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. #15
    Registered Member
    Join Date
    Aug 2004
    Posts
    10
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Help on moving cpanel accounts from damaged disk

    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.

Page 1 of 2 12 LastLast

Similar Threads

  1. deleted a directory within virtfs,damaged cpanel , Help
    By musti19 in forum General Discussion
    Replies: 5
    Last Post: 05-27-2014, 12:34 PM
  2. Moving CPanel accounts to a new server
    By Alvin Rebulado in forum General Discussion
    Replies: 1
    Last Post: 10-17-2012, 04:49 AM
  3. Moving multiple email accounts to cpanel
    By cisnet in forum E-mail Discussions
    Replies: 2
    Last Post: 03-03-2008, 10:24 PM
  4. Problems moving accounts between cPanel servers
    By kamnet in forum General Discussion
    Replies: 22
    Last Post: 06-15-2006, 04:40 PM
  5. Moving Ensim 3.1.X accounts to CPanel 8.8.0
    By uh2 in forum General Discussion
    Replies: 0
    Last Post: 02-15-2004, 06:06 AM
bargain