Backup and restore E-Mail

  • Hallo,


    I moved to another server and copied my backup files including the e-mail backup to the backup directory of the domain. I pressed the restore button and domain, subdomains and sql databases got restores. But why is the e-mail backup not restored?


    Is there something i have to do?

  • @UncleSam


    The mails are part of the backup process but they are not part of the restore process ;) To resume here, you must restore them manually under the /var/mail/virtual directory.


    Once done, run the perl /var/www/imscp/engine/setup/set-engine-permissions.pl -v to fix permissions.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Ok thank you very much for your answer.


    Before I saw your answer I transfered just the missing folders and mails and replaced the file "subscription". After it I set the folder permission to "vmail:mail" - this worked for me but I run the permission script later when I am back at my pc.


    Is there any plan to include a restore process for emails too?

  • @UncleSam


    Yes. This is planned for v1.4.0 ;) We cannot do that before because this would involve too much changes in core.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • I have no idea if it is a "perfect" way or not (... I think It's not, but it's working). I am not a professional in postfix or dovecot - so please check my answer before trying it at your productive server!!! If someone has the know how to proove or correct my solution, please tell us all the "perfect" solution for further restores :-).


    My restore process for e.g. [email protected]:

    • I extracted my backup of /var/mail/ into a seperate place: /backup/
    • Copied the file "subscriptions" from backup to mail folder:
      Code
      1. cp /backup/var/mail/virtual/domain.tld/mail/subscriptions /var/mail/virtual/domain.tld/mail/
    • After that I copied all mails:
      Shell-Script
      1. cp -r /backup/var/mail/virtual/domain.tld/mail/.* /var/mail/virtual/domain.tld/mail/
    • IMPORTANT: run the snipped from Nuxwin to correct the permissions!
      Shell-Script
      1. perl /var/www/imscp/engine/setup/set-engine-permissions.pl -v


    My restore process timeline:

    • Created the new server parallel, installed I-MSCP and created all mail boxes again.
    • Switched dns from old server to new server IP.
    • Waited about two days that every host in the world wide web knows the new server.
    • Did a backup of /var/mail/ on the old server and copied it to the new one.
    • Restored the way I told above.

    In my situation this was the best solution. Every mailbox was empty for some days or only filled with new mails. After copying the old mails backupthere should be every mail there, even the mails which were sent to the old server during dns change.