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.

rsync or scp script for moving emails from one server to another

Discussion in 'E-mail Discussions' started by albatroz, Sep 21, 2016.

  1. albatroz

    albatroz Well-Known Member

    Joined:
    Mar 6, 2003
    Messages:
    258
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virtual Orbis / Peru
    cPanel Access Level:
    Root Administrator
    Hello,
    We recently moved a domain to another server but some new emails were not moved
    so I am looking for a sample scp or rsync command that I could use to move the
    emails from the old server. The idea is something like this:

    Source: IP1 /home/account/mail/domain.com/*/new
    Destination: IP2 /home/account/mail/domain.com/*/new

    I did something like this for one account but I need to repeat the process for
    all the email accounts: scp * root@IP:/home/account/mail/domain.com/username/new

    Any suggestion?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello :),

    Yes, you can migrate your all email accounts mail from old server to new server with the following command.

    Code:
    rsync -av --progress /home/account/mail/domain.com/* DestinationServerIP:/home/account/mail/domain.com/
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Yes, it's possible to use a command like the one referenced in the previous response. Note you may want to run the following command on the destination server after copying the email data:

    Code:
    /scripts/mailperm --username
    Thank you.
     
Loading...
Similar Threads - rsync scp script
  1. Shane3673
    Replies:
    3
    Views:
    317

Share This Page