Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

Legacy restore, why copy twice?

Discussion in 'Data Protection' started by mindnetcombr, Aug 15, 2017.

Tags:
  1. mindnetcombr

    mindnetcombr Active Member

    Joined:
    Sep 16, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156
    I know legacy backup/restore is dead, but today I need restore a cpanel server with legacy restore, 1Tb of data.

    All data stored on a backup hdd, without compression, without .tar or .tar.gz - my backup is incremental, file by file, folder by folder.

    This is how legacy restore work:

    1) copy the account backup to a temporary folder inside the backup disk;
    2) copy the data copied to temporary folder, to the final destination (/home);

    Repeat this 600 times, with 1Tb of data.

    A big waste of time and resources, why legacy copy to a temporary location to after this restore the account? Why not restore direct from /backup/cpbackup/daily/account_login/ ????

    This temporary copy double the time necessary to restore, and stress the backup disk with a lot of writes.

    I dont know how the new restore system work, I hope not in the same way. This dont make sense, just lock backups while do restore.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,445
    Likes Received:
    56
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    The simplest way for you would be that you just create an archive from those user backup folder and restore it directly..

    # tar -zcvf user.tar.gz user

    This will create a tar and then you can restore it directly..
     
  3. mindnetcombr

    mindnetcombr Active Member

    Joined:
    Sep 16, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156

    Yes but I will lose more time, to compact the backup to .tar.gz, and when use /restorepkg /backup/cpbackup/daily/user.tar.gz this script will create temporary files again on /backup/cpabackup/daily/cpanelpkgrestore.TMP.work.SOMETHING/

    Compact to .tar.gz to restore will not avoid cpanel to use the temporary folder.

    This issue is similar to this one:

    restorepkg can't restore from a read-only file system

    cpanel legacy restore ALWAYS copy the backup to a temporary folder before restore. This step is not necessary since in a incremental backup all files are uncompressed.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can browse to "WHM >> Backup Configuration", configure the "Incremental" backup type, configure the local backup directory to the partition where the incremental backups are stored, and then move the existing incremental backups to the "/$configured-backup-dir/date/accounts" location. Once you do this, the backups should appear in WHM's Backup Restoration interface under the appropriate account and date.

    Thank you.
     
  5. mindnetcombr

    mindnetcombr Active Member

    Joined:
    Sep 16, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156
    Michael, in this case the "new" backup system will restore without create a temporary copy? Restore will go direct from date/accounts to user account?

    thank
     
  6. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,445
    Likes Received:
    56
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Restoration will create a temporary session for restoration. What exact is the issue you are facing with temporary sessions/copy?
     
  7. mindnetcombr

    mindnetcombr Active Member

    Joined:
    Sep 16, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156

    the issue is the time.

    for every account restored I need wait cpanel create a temporary copy. So one account with 80Gb, 200.000 inodes, this take almost 1 hour.

    I have 600 accounts, fresh hardware, and more than 30 hours of restore.

    If dont have the temporary copy, this will take half time.

    This is the issue.

    thank
     
  8. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,445
    Likes Received:
    56
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    I would suggest you do as suggested by the Michael for one account and see what occurs and how much time it takes for it to restore..
     
  9. mindnetcombr

    mindnetcombr Active Member

    Joined:
    Sep 16, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156
    Yes I will! thank everyone!
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Temporarily files are utilized, however the restore feature runs a check before starting the restoration process to ensure enough disk space is available. EX:

    Code:
    Target “/backup/2017-08-17/accounts” on host “123.hostname.tld” has 11.16 GB free and requires at least 67.4 MB free, which includes space for temporary files. 
    Thank you.
     
  11. mindnetcombr

    mindnetcombr Active Member

    Joined:
    Sep 16, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156
    Hello,

    Today I run a test: using the new backup system, I restored one account with 14Gb.

    Unfortunately the backup system first copie the entire backup (14Gb) to a temporary directory /backup/date/accounts/cpanelpkgrestore.TMP.work.RuFrBXh5

    Well... I have the incremental backup, so all files on my backup are ready to be restored (no .tar or .tar.gz).

    The restore system copy all data to a temporary folder, and only after this restore the account - dont make any sense with a incremental backup setup.

    This "step" (copy to temporary folder) only add time to restore and unnecessarily generates writing on the backup disk, which may be undesirable, because when restoring a backup is a moment that can be critical and the last thing we want is to stress the backup disk.

    I understand when the backup have the format .tar or .tar.gz is necessary copy to a temporary folder to extract the files, but with "incremental" option this temporary copy is useless.

    Maybe someone from cpanel reads this and agrees with my argument, if any, thank you bring the matter to the developers. There could be an automatic scan if the backup is incremental so do not use temporary folder.

    To finish: 1Tb restore of 600 accounts, in a new hardware (Xeon 1270 V6 + 32Gb RAM + Adaptec RAID1 7.2K) took 30 hours. Half this spent with cpanel copying backup to temporary folders unnecessarily.

    Thank
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The following feature would likely help to some extent if you did not need to restore the entire account:

    cPanel user Granular backup/restore

    However, I encourage you to open a separate feature request if you'd like to see new functionality that doesn't make use of a temporary directory for restoration purposes:

    Submit A Feature Request

    Thank you.
     
  13. mindnetcombr

    mindnetcombr Active Member

    Joined:
    Sep 16, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156


    Thank you.

    I will do this, and I will pray that other users will need to do incremental backup restore faster, so maybe - with many votes - cpanel.net decides to make this small change.
     
Loading...

Share This Page