Migrating Mail Users & Mail To ISPConfig

Discussion in 'General' started by BrianHill, Aug 1, 2017.

  1. BrianHill

    BrianHill New Member

    I'm taking on a project to update our customer mail server. Currently it's running a Postfix/Courier/Horde setup with no control panel software. I would like to update it to a Postfix/Dovecot/ISPConfig/Roundcube configuration instead.

    The old server is storing mail in the MailDir format. This should make migrating the mail a lot easier. What I'm not sure about is how to migrate the user accounts. In other posts I've read people are creating the accounts in ISPConfig and then migrating the MailDir files over afterwards. This is not an option for us.

    We're trying to migrate approximately 26,000 mailboxes. If a password reset is required then so be it, but ideally we'd like to be able to just import the accounts into ISPConfig, then import the MailDir files from the old server to the new server.

    Does anyone know if this is possible, and does anyone have any tools, scripts, or utilities that they can suggest to help with the migration?

    Thanks in advance!
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Your actual requirements are likely pretty simple, find and tweak a script that uses the remoting api to create your users (test it a bit and I'd expect you could import your existing password hashes to avoid password resets), and use rsync to copy over the mailboxes. I don't know how often your user accounts change (add/delete or password changes), you may or may not have to run your user create script multiple times - you will definitely need to rsync multiple times, to bring "all the data" over, then changes since your first sync, then maybe another pass of changes again, then turn off pop/imap/smtp on the old server before doing a final sync and enabling services on the new.

    Depending on how long an rsync takes (in particular, how long that final sync with services shut down takes), you might have to put a pop/imap/smtp proxy in place and migrate accounts in stages to avoid too much downtime. Eg. move all mailboxes starting with a-d*, then move e-h* next, etc. Look at http://horms.net/projects/perdition/ for pop/imap proxy, and a simple regex in postfix access map could convince it to relay mail where it is needed.

Share This Page