rsync or scp script for moving emails from one server to another
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?
-
Hello :), Yes, you can migrate your all email accounts mail from old server to new server with the following command. rsync -av --progress /home/account/mail/domain.com/* DestinationServerIP:/home/account/mail/domain.com/0 -
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: /scripts/mailperm --username
Thank you.0 -
is there a way to force the recreation of index files of Dovecot after this sync process? 0 -
is there a way to force the recreation of index files of Dovecot after this sync process?
Yes, you can remove the index files via the following script, as they are regenerated upon login:# /scripts/remove_dovecot_index_files /scripts/remove_dovecot_index_files Utility to remove Dovecot index files. Available options: --user [cPanel username] Remove Dovecot index files from all email accounts setup under the specified cPanel user. Can be specified more than once, to process multiple users at once. --reseller [reseller username] Remove Dovecot index files from all email accounts setup under all the cPanel accounts owned by the specified Reseller. Can be specified more than once, to process multiple resellers at once. --all Remove Dovecot index files from all email accounts setup on the server. --verbose Prints the full paths of the files being removed. --help Prints this help text.
Thank you.0 -
Hi, after: rsync -av --progress /home/username/mail/domain.com/* DestinationServerIP:/home/username/mail/domain.com/ I have problem: No such user for all emails on domain.com /scripts/mailperm --username didn't help Any ideas ? 0 -
I have problem: No such user for all emails on domain.com
Hello, You'd need to first re-create the email accounts via cPanel before syncing over the email data. Thank you.0 -
For reference, here's the rsync command I used to copy mail from a remote server, to the server the command is running on: rsync -avzh --progress root@REMOTESERVERHOST:/home/account/mail/domain.com/* /home/account/mail/domain.com/0
Please sign in to leave a comment.
Comments
7 comments