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.

/scripts/restorepkg behavior

Discussion in 'Data Protection' started by GOT, Jun 5, 2016.

  1. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    When using /scripts/restorepkg command to restore an account from a backup without terminating it first, does it do the following:

    Files in homedir (mail, public_html) that have been removed from the backup but still exist on the live site, are tehr emoved files removed, or do they remain?

    Databases that were dropped and do not not exist in the backup, are they dropped when restoring the account?

    I'm basically syncing backups from a production environment and restoring them on a standby server and I am wondering if I need to terminate the accounts first, or can I simply restore them with the --force option?
     
  2. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    Did some testing and deleted files in the backup are deleted from the userdir when restored, so that's good. Will be testing the databases over the next couple of days.
     
  3. 24x7serversecurity

    Joined:
    Aug 31, 2015
    Messages:
    19
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hey :),

    When your restore any account using --force option, the account gets forcefully overwritten with all the files, databases etc. So if anything doesn't exist in the backup but exists in the account, will get deleted when your restore the account.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Documentation on /scripts/restorepkg is available at:

    Restore Package Script - Documentation - cPanel Documentation

    Using the --force flag restores the account, and any existing data remains intact on the server. Thus, it's likely a good idea to terminate the account first, then restore it, if you want it to completely match the backup archive contents.

    Thank you.
     
Loading...

Share This Page