The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel migration from crashed server’s backup to new server.

Discussion in 'General Discussion' started by imran_khan, Jul 25, 2013.

  1. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello,

    Just I want to know the step by step procedure for Disaster Recovery of Cpanel server.
    E.g. My cpanel server1 is crashed. I have full Cpanel backup of it.
    I have installed the same or latest version Linux operating system on new server2 and installed the latest version of Cpanel.
    Please let me know the recommended procedure.

    Thanks,
    Imran Khan.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The supported method is to restore cPanel-generated backups. Do you have individual backups of the accounts? If so, you can restore them via:

    "WHM Home » Backup » Backup Restoration"

    Thank you.
     
  3. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello,

    Thanks for the reply. I have multiple accounts and have full backup of Cpanel server1 and I want to restore the whole backup (configuration file, log file, account necessary files) to on new Cpanel server2.

    Scenario:-
    If my server1 crashed and not booting up or hard disk data is corrupted. Now I have full backup of this server.
    Then I have installed the Linux OS and Cpanel in server2. Just let me know the step by step procedure to restore backup or migration.

    Hope you understand my query.

    Thanks,
    Imran Khan.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    There are no supported methods of restoring an entire file system. The only supported method is to restore the accounts from the individual cPanel-generated backup files, which include all of the necessary configuration data for the accounts. There are some unsupported methods of restoring a damaged server on the following thread:

    Moving cPanel Accounts from Damaged Disk

    Thank you.
     
  5. Tom Risager

    Tom Risager Well-Known Member

    Joined:
    Jul 10, 2012
    Messages:
    107
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Copenhagen, Denmark, Denmark
    cPanel Access Level:
    Root Administrator
    The backup system has an option to backup system files, with the text "This option is not needed for account restoration, but it is needed for server restoration. Enabling this option is highly recommended."

    What is the recommended use of the system backup files during a complete restore of a dead cPanel server? After reinstalling cPanel using the install script, can the backed-up system files be restored over the default ones to quickly recover the configuration of the old server?
     
  6. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    I am not asking about file system and crashed server.

    Assumption:-
    My server1 is crashed but I have full Cpanel backup of 50 accounts and this backup is on my backup server.
    Install the Linux OS and Cpanel on new server2. So please let me know the procedure to restore or migrate data.
    I don’t want to restore data from damaged hard disk of server1. I want to restore or migrate data from backup which took on my backup server.

    Thanks,
    Imran Khan.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you clarify if you have individual backups of the accounts that you are able to restore? If so, the next step would be to restore the individual account backups via:

    "WHM Home » Backup » Backup Restoration"

    The configuration files that are backed up for the system are not really intended for a new server. The account backups will automatically populate most of those files with the necessary data when the accounts are restored. You could restore the /etc/my.cnf file if you have custom modifications to it. Other than that, it's a good idea to run EasyApache to ensure the modules/versions of your preference are enabled. Also, you can browse to "Tweak Settings" and "Exim Configuration Manager" in Web Host Manager to choose any specific options that you may have enabled before.

    Thank you.
     
  8. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    In server1 I have configured the weekly Cpanel backup and have 50 accounts in this server. If server1 goes down and hard disk is also corrupted.
    Now I have installed the Linux Operating System and cpanel on new server2. I want to restore the full cpanel backup with all the 50 accounts mails, web sites and database data in one shot on server2. I want server2 as it is server1 in term of Cpanel data. How can I do this without pain?

    Thanks,
    Imran Khan.
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can simply upload the backups to the new server and restore them via:

    "WHM Home » Backup » Backup Restoration"

    The following document is intended for backups stored on a remote FTP server, but it also applies to your specific case:

    Restoring Backups From A Remote Server

    Thank you.
     
  10. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello,

    Can I follow the below procedure after the installation of WHM/Cpanel on new server.

    1). Compress the daily/weekly/monthly cpanel backup using below command.

    # tar –vzf cpbackup.tar.gz /home/daily/ (Assuming daily backup copied from backup server to new cpanel server in /home folder).

    1). List user name in list_of_users file.
    2). Run the below command.

    # for x in $(cat /root/list_of_users); do /scripts/restorepkg /home/cpbackup.tar.gz; done;

    Where,
    cpbackup.tar.gz = cpanel daily backup
    list_of_users = list of users.

    Also please let me know, what are the dirs and files directories in every cpanel backup.

    Thanks,
    Imran Khan.
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    There is no need to manually import files/directories for the accounts because they are already included in the account backup archives. Rather than compressing all of the individual account backup archives together, you can simply move them to the /home directory on the new server. Here is a slight modification to the command you referenced:

    Code:
    for x in $(cat /root/list_of_users); do /scripts/restorepkg $x ;done
    Thank you.
     
  12. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    Thanks. I will try and update you..


    Thanks,
    Imran khan.
     
  13. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello,

    I have followed the below steps.

    1). Copied Cpanel daily backup from backup server to new cpanel server under /home/.
    Folder daily, files and folders are as below.

    root@www [/home/daily]# ll
    total 24
    drwxrwxrwx 5 root root 4096 Jul 31 21:12 ./
    drwx--x--x. 10 root root 4096 Jul 31 20:40 ../
    drwxrwxrwx 34 root root 4096 Jul 31 20:19 xyz/
    -rw-r--r-- 1 root root 25 Jul 31 20:27 cpbackupstatus.cfg
    drwxrwxrwx 15 root root 4096 Jul 31 20:24 dirs/
    drwxrwxrwx 2 root root 4096 Jul 31 20:27 files/

    2). Created list_of_users file with username xyz under /root/.
    root@www [~]# cat list_of_users
    xyz

    3). Ran the command (for x in $(cat /root/list_of_users); do /scripts/restorepkg $x ;done) and getting below error.

    root@www [~]# for x in $(cat /root/list_of_users); do /scripts/restorepkg $x ;done
    cPanel restorepkg 2
    Force Mode: no
    Reseller Privs Restore: yes

    Searching /home....
    checked 6 files.....
    No Restorable archives found!
    Searching /home2....
    checked 0 files.....
    No Restorable archives found!
    Searching /home3....
    checked 0 files.....
    No Restorable archives found!
    Searching /root....
    checked 11 files.....
    No Restorable archives found!
    Searching /usr....
    checked 14 files.....
    No Restorable archives found!
    Searching /usr/home....
    checked 0 files.....
    No Restorable archives found!
    Searching /web....
    checked 0 files.....
    No Restorable archives found!
    No archives were found for user xyz!!This feature will restore full backups,
    cpanel backups and cpanel move files in one of the following formats:
    cpmove-{USER} cpmove-{USER}.tar cpmove-{USER}.tar.gz
    USER.tar USER.tar.gz backup-{BACKUP-DATE_TIME}_{USER}.tar
    backup-{BACKUP-DATE_TIME}_{USER}.tar.gzThe files must be in one of these directories
    on the server: /home, /home2, /home3, /root, /usr, /usr/home, /webYou must upload the
    file to one of the above locations before using this feature.

    Thanks,
    Imran khan.
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    There are no account backup archives in the backup directory that you copied over. Are you sure account backups were enabled on the source server? Did you have legacy backups enabled on the source server, or did you use the new backup system? Note the path to backup archives for the new backup system is typically configured as:

    Code:
    /backup/$date/accounts/
    Thank you.
     
  15. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    Thanks for the reply. In my old server I am using Cpanel 11.36.0 (build 21) with CentOS-5.8 and new server using Cpanel 11.38.1 (Build 15) with CentOS-6.4.
    I have attached backup configuration screen shot with this thread. In daily backup folder account xyz is showing. I have copied daily backup folder in /home folder.
    Can I compress daily folder and try below command, please let me know.

    # tar –vzf cpbackup.tar.gz /home/daily/
    # for x in $(cat /root/list_of_users); do /scripts/restorepkg /home/cpbackup.tar.gz; done;

    Thanks,
    Imran Khan. bkp-1.jpg bkp-2.jpg
     
  16. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You were using incremental backups. You can simply compress the account username directory instead of the entire "daily" directory. The name should be the username of the account instead of "cpbackup.tar.gz".

    EX:

    Code:
    tar –vzf xyz.tar.gz /home/daily/xyz
    You do not need to use a special command if you are only restoring a single account. You can simply use:

    Code:
    /scripts/restorepkg xyz
    Thank you.
     
  17. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    It is possible to restore one account and what about multiple accounts?
    Also let me know, what about dirs and files directories which are in daily backup folder.

    Thanks,
    Imran Khan.
     
  18. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You only listed one account directory when you pasted the output of your backup directory earlier in this thread. If there are in-fact multiple account directories that were backed up, you can compress each account backup directory individually, and then restore them using the one-liner referenced earlier.

    The "dirs" and "files" directories are the configuration data that was backed up. Per my earlier response:

    The configuration files that are backed up for the system are not really intended for a new server. The account backups will automatically populate most of those files with the necessary data when the accounts are restored. You could restore the /etc/my.cnf file if you have custom modifications to it. Other than that, it's a good idea to run EasyApache to ensure the modules/versions of your preference are enabled. Also, you can browse to "Tweak Settings" and "Exim Configuration Manager" in Web Host Manager to choose any specific options that you may have enabled before.


    Thank you.
     
  19. imran_khan

    imran_khan Well-Known Member

    Joined:
    Jun 10, 2013
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello,

    Thanks.

    I have followed the below steps.

    1). tar –vzfc daily.tar.gz /home/daily.
    2). tar –vzfc xyz.tar.gz /home/daily/xyz
    3). And ran the below command.

    root@www [/home]# /scripts/restorepkg xyz
    cPanel restorepkg 2
    Force Mode: no
    Reseller Privs Restore: yes

    Searching /home....
    Found xyz.tar.gz !
    Extracting tarball...................
    ..............................
    ..............................
    ..............................
    ..............................
    ..............................
    ..............................
    ..............................
    ..............................
    ..............................
    ...............Doneexpected extraction point xyz was not found. Guessing the tar dir is daily/xyz based on the extraction results.
    Extracting Domain....DoneGenerating Account.... query failed: Send error: Network is unreachable

    Above command first check the data in xyz.tar.gz and it directly check in daily.tar.gz. Why it is not using xyz.tar.gz?

    Thanks,
    Imran Khan.
     
  20. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You do not have to compress your "daily" directory. You can not restore multiple backups by compressing the individual backup files archives together.

    Feel free to open a support ticket if the issue persists so we can access your system directly to see how your backups have been configured:

    Submit A Ticket

    You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page