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.

Restore home directory backup from account root?

Discussion in 'Migrate to cPanel' started by sch, Feb 14, 2012.

  1. sch

    sch Member

    Joined:
    Jan 10, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Is it possible to restore a home directory backup [created in cPanel backups] in root of an account that was sent remotely to a new server?
     
  2. JeffP.

    JeffP. Well-Known Member

    Joined:
    Sep 28, 2010
    Messages:
    164
    Likes Received:
    9
    Trophy Points:
    18
    Hi sch,

    The home directory backup will contain all data under /home/${USER}/ for a cPanel user. It is possible to restore such a backup for an account on another server. To do this, I would place the file in the root of the account as you mentioned, where the root of the account would be "/home/${USER}/".

    Next, I would change the permissions of the backup file to that of the user:

    Code:
    # chown ${USER}:${USER} ${BACKUP_FILE}
    Then I would log in as that user:

    Code:
    # /bin/su -s /bin/bash ${USER}
    and finally, I would extract the file:

    Code:
    $ tar zxvf backup-${DATE}_${USER}.tar.gz
    You may want to test this with a test account first, just to be sure that these commands do what you would expect them to.

    If you run into any issues, just let us know.

    Thanks!
     
  3. sch

    sch Member

    Joined:
    Jan 10, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Ok, that would have worked, but appears to be an error somewhere. It got up to one of the databases ad then got this:

    tar: Skipping to next header
    tar: Exiting with failure status due to previous errors

    Is it safe to assume the error is with the last database it was attempting to import? I know that database is quite large and when attempting to import via phpMyAdmin, one of the tables had an error.

    If that is the case, can a home directory backup be created minus the database(s)?
     
  4. JeffP.

    JeffP. Well-Known Member

    Joined:
    Sep 28, 2010
    Messages:
    164
    Likes Received:
    9
    Trophy Points:
    18
    In my testing, home directory backups don't contain databases. Can you please confirm that the backup you're working with was created via cPanel >> Backups >> Download a Home Directory Backup? Note that there is a separate section below that for downloading database backups: Download a MySQL Database Backup.
     
  5. sch

    sch Member

    Joined:
    Jan 10, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Your right. Although I planned on it and didn't, I was thinking I had created and uploaded a home directory backup. I guess the reason for that is when attempting to restore a full backup, I kept getting errors like:

    "Sorry, we were unable to transfer the account. Information about zerish's primary domain is either missing or corrupt"

    Seems like I can't win for losing.
     
  6. JeffP.

    JeffP. Well-Known Member

    Joined:
    Sep 28, 2010
    Messages:
    164
    Likes Received:
    9
    Trophy Points:
    18
    That can happen if the backup was not able to be created properly. For example, if the server ran out of disk space while the backup was being created, that could prevent all data from being written to the backup file.

    Do you have root access on the server where the backup for zerish was made? If you'd like, please open a ticket (see my signature) and we'll be happy to take a look.
     
  7. sch

    sch Member

    Joined:
    Jan 10, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Opening a ticket now.

    Thanks.
     
Loading...

Share This Page