How can we help?

Watch this space: Upcoming Help Centre Migration


Migrating from IMail to Atmail 6.x.x

Stewart -

I want to migrate from IMail to Atmail 6.x.x.


  • On-Premise Server + WebMail Installations: Version 6..x.x

Migration requirement


  1. The following scripts are used to complete an IMail to Atmail 6.x.x migration:
  2. Copy /usr/local/atmail/webmail/utilities/migration/imail/ to the IMail server
  3. If you don't have Perl installed on the IMail server you will need to install it now.
  4. From the Windows command line move to the directory containing and execute the following commands:
    # perl -users
    # perl -useraliases
    # perl -hostaliases
    NOTE: You may need to type the full path to the "perl" binary.
  5. Once these commands have completed you should have the following three files in the current working directory:
  6. Copy the three files above to the Atmail server. For this tutorial we will presume the files are copied to/tmp/imail-data/ on the Atmail server.
  7. Move to the imail migration scripts directory on the Atmail server:
    # cd /usr/local/atmail/webmail/utilities/migration/imail
  8. Execute the following command which will migrate IMail users, user aliases and host aliases into Atmail:
    # php import-users.php /tmp/imail-data/ admin
    (usage: php import-users.php [path to imail data] [atmail admin username])
    Once this script has completed all IMail users, user aliases and host aliases should now exist on the Atmail system.
  9. Now take a copy of all the email on the IMail system and move it onto the Atmail system. Again we will presume the location it's moved to is /tmp/imail-data/ on the Atmail server. You will want to shutdown the IMail server while this is done, so that no new emails arrive on the IMail system.
  10. Now move back to the Atmail server. We now need to make sure the email dump is in the correct format. When the email archive is extracted it should have a directory for each domain the system hosted. e.g.:
    and so on...

    If the names of the directories are not the proper domain names you will need to rename them. For example if we have "/etc/imail-data/domain-two" for the users then rename it to. Basically each directory that contains the users for each domain should be named using the full domain name."/etc/imail-data/"
  11. Once we have all the directories with correct names matching the domains whos data they contain we can start the email migration process. Run the following script:
    # php migrate-msgs.php /tmp/imail-data/ admin
    This script will recursively transverse the directory given in the first argument and search for directories containing IMail email data. Each time it finds one it will add the domain name into the Atmail system (using the name of the parent directory, hence the need for it to have the same name as the domain). It will then process all the email data for each user, transfering it from the mbox format into each users corresponding MailDir. The script will create any new mail folders it needs to for each user as it goes.
    Some folders will be renamed:
    • Main.mbx will become Inbox
    • Draft.mbx will become Drafts
    • Deleted.mbx will become Trash
  12. All email should now be imported. You could now switch MX records to the Atmail server so that your users now start to receive their mail once again. Make sure the Atmail server is running:
    # /etc/init.d/atmailserver restart
  13. Now to import your users' address book data:
    # php migrate-abook.php /tmp/imail-data admin
    The script will recurse through all subdirecties of the given path looking for address book data for each user. Once found it will import each user's addressbook data into their Atmail address book. 
  14. Migration complete.


Contact our support team

+61 (7) 5357 6605