Skip to main content
  1. Posts/

Moving mail between some Plesk servers

··115 words·1 min·

If you’re migrating a domain, sometimes their mail will go to the old server for a while after you’ve changed the DNS. You can move their mail to the new server by following these steps:

  1. Go to the user’s Maildir directory

cd /var/qmail/mailnames/<domain>/<user>/Maildir

  1. Tar their mail directories

tar cvzf <user>.tar.gz cur new tmp

  1. Move to a web accessible location

mv <user>.tar.gz /home/httpd/vhosts/<web-accessible-domain>/httpdocs/

  1. Log onto the second server and go to the user’s Maildir directory

cd /var/qmail/mailnames/<domain>/<user>/Maildir

  1. Retrieve the user’s mail tar file that you created

wget http://<web-accessible-domain>/<user>.tar.gz

  1. Un-tar the files to their correct locations

tar xvzf <user>.tar.gz

  1. Remove the tar file

rm <user>.tar.gz

  1. Go to the original server and remove the tar file

rm /home/httpd/vhosts/<web-accessible-domain>/httpdocs/<user>.tar.gz