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.

Email recovery on different WHM host

Discussion in 'E-mail Discussions' started by doulos61, Dec 6, 2014.

  1. doulos61

    doulos61 Well-Known Member

    Joined:
    Dec 13, 2006
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Greetings -

    I know this can be done just trying to thinking there is someone more experienced in an effective manner in which to do it.

    A client recently deleted all their email on the server. This is for a legal firm so I was asked to make the best efforts to restore the data. Since all I have is the entire container backed up, I had to restore the backup to a different server due to space issues. I have extracted the old home folder to a location on the second server.

    My thinking is that I can create an email account on one of the hosted domains on the second server, set the permissions to the extracted email for the account that was just created, move the email data to proper mail hierarchy and then try to access the email.

    If successful at that point either I or the client can retrieve the data.

    Also, if it would suit it better, I could always compress the extracted email data, upload it to the original host, extract it there and then place it back in its original location... just a though.

    I would appreciate the input, directions or suggestions.
    Please assist
    Thanks
    Shoop
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    recreate the deleted email accounts as they were & rsync the mail from the backup
     
  3. doulos61

    doulos61 Well-Known Member

    Joined:
    Dec 13, 2006
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Would that command line basically be? -

    rsync -avHz /source/path/mailbackup/ /target/path/mail/
     
  4. MilesWeb

    MilesWeb Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2012
    Messages:
    174
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    If you have the backup of etc and mail folder there won't be a need to re create the email accounts. Sync these 2 folders and the data will be restored.

    As you have extracted the backup on other server the command will be as below. This command needs to be executed on the server where the backup is extracted.

    rsync -va -e "ssh -p 22" /source/path/mailbackup/etc root@server-ip:/home/cPanel-username/
    rsync -va -e "ssh -p 22" /source/path/mailbackup/mail root@server-ip:/home/cPanel-username/

    Correct the ownership & this should be it.
     
  5. 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 :)

    Yes, manually moving the data back into place in the "etc" and "mail" directories will restore the email accounts. Ensure you update the ownership values and run the following command:

    Code:
    /scripts/mailperm $username
    Thank you.
     
Loading...

Share This Page