I want to migrate from IMail to Atmail 6.x.x.
- On-Premise Server + WebMail Installations: Version 6..x.x
- The following scripts are used to complete an IMail to Atmail 6.x.x migration:
/usr/local/atmail/webmail/utilities/migration/imail/migrate-imail.plto the IMail server
- If you don't have Perl installed on the IMail server you will need to install it now.
- From the Windows command line move to the directory containing migrate-imail.pl and execute the following commands:
# perl migrate-imail.pl -usersNOTE: You may need to type the full path to the "perl" binary.
# perl migrate-imail.pl -useraliases
# perl migrate-imail.pl -hostaliases
- Once these commands have completed you should have the following three files in the current working directory:
- 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.
- Move to the imail migration scripts directory on the Atmail server:
# cd /usr/local/atmail/webmail/utilities/migration/imail
- Execute the following command which will migrate IMail users, user aliases and host aliases into Atmail:
# php import-users.php /tmp/imail-data/ adminOnce this script has completed all IMail users, user aliases and host aliases should now exist on the Atmail system.
(usage: php import-users.php [path to imail data] [atmail admin username])
- 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.
- 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 domain-two.com users then rename it to. Basically each directory that contains the users for each domain should be named using the full domain name.
- 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/ adminThis 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
- 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
- Now to import your users' address book data:
# php migrate-abook.php /tmp/imail-data adminThe 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.
- Migration complete.