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.

Copying Part of the Mail folder to new hosting

Discussion in 'E-mail Discussions' started by percolateddesign, Feb 20, 2017.

  1. percolateddesign

    Joined:
    Feb 14, 2017
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Reseller Owner
    I have just transferred several mail accounts from one cpanel hosting account to another. Everything is working but there was a gap between when I ran the backup and moved the files over to when I transferred the DNS so the are about a week or so of emails missing. I have a current backup of the mail folder from the old hosting account but I am afraid to copy it all over in case it over writes any emails that have arrived this morning. Is it possible to just select the last two weeks of emails in the cur folder and copy them over via ftp or will I also need to update over files?
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    You would want to use rsync, it will only copy the emails that do not exist in the new location, example:

    Code:
    # rsync -ahvz /backup/user/mail/domain.com/ /home/user/mail/domain.com/
    The first path is the path to the current backup where you want to sync the emails FROM, and the second path is the current path to where the live emails reside.

    If you are using rsync as root, you will want to chown the mail folder as the user after running rsync

    Code:
    # chown -R user: /home/user/mail/domain.com
     
    cPanelMichael likes this.
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    You may also want to run the following command when using instructions like the one in the previous response:

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

Share This Page