help centre
For more info visit status.atmail.com

How can we help?


Search our knowledge base for answers to
common questions and latest updates.



My activities New request

Follow

Migrate from atmail 7 to atmail mail server

Stewart -

PROBLEM
How can I migrate from my atmail 7 server to my atmail mail server?

ENVIRONMENT

  • atmail mail server
  • atmail 7 server + webmail

CAUSE
Migration requirement.

RESOLUTION

IMAPSYNC (http://imapsync.lamiral.info/) is an IMAP migration utility by Gilles Lamiral which is capable of transporting your IMAP messages from one server to another. This document details how to transport your atmail 7 messages to an atmail mail server installation using IMAPSYNC

EXPORT USERS

You will need to build a list of users from atmail 7 in the following CSV format. 

Email address, First name, Last name, Password

Example

Email address, First name, Last name, Password
sample1@mydomain.com,FirstName,LastName,changeme
sample2@mydomain.com,FirstName,LastName,changeme
sample3@mydomain.com,FirstName,LastName,changeme

MySQL Export

MariaDB [atmail7]> select Abook.UserEmail,Abook.UserFirstName,Abook.UserLastName,Users.Password from Abook,Users  where Abook.Global='1' Group by Users.Password INTO OUTFILE '/tmp/users.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';

IMPORT USERS

Log into your webadmin and go to Account Manager. Click the import users button and follow the onscreen prompts to upload your CSV and import your users. 

MIGRATE EMAIL MESSAGES

First, install IMAPSYNC. You can either purchase the full source, or grab earlier versions from Ubuntu/Debian repositories. Once done, generate a list of your users in this format:

[source-username],[password],[destination-username],[password]

Where [source-username] is the source IMAP username, and [destination-username] is the username for your destination IMAP server. Separate new entries with newlines, like so: 

sample1@mydomain.com,password,sample1@mydomain.com,password
sample2@mydomain.com,password,sample2@mydomain.com,password sample3@mydomain.com,password,sample3@mydomain.com,password 

Save the file as migrate-users.csv. Then, in the same directory, execute this command: 

{ while IFS=',' read u1 p1 u2 p2; do
imapsync --host1 [source-hostname] --authmech1 PLAIN --user1 "$u1" --password1 "$p1" --prefix1 INBOX. --sep1 / \
--host2 [destination-hostname] --authmech2 PLAIN --user2 "$u2" --password2 "$p2" --prefix2 INBOX. --sep2 . ...
done ; } < migrate-users.csv

Replace [source-hostname] with the hostname/IP of the source server. Replace [destination-hostname] with the hostname/IP of the destination server.

Executing the above command will then import all emails to the destination accounts.

Please note, this article presumes that the namespace separator of host1 is "." and host2 is ".". 

--prefix1 INBOX/ --sep1 .
--prefix2 INBOX. --sep2 .

These are optional, but may be necessary as atmail strictly uses "." throughout its front end infrastructure. 

Note: When migrating, the order of messages in the inbox will be arranged/displayed by the date the message was last modified (Not necessarily the date the email was received).

FURTHER INFORMATION

Please Note:
Passwords used in the CSV files must be plaintext.

Currently only users and their mail can be migrated from an atmail 7 installation to and atmail mail server installation using scripts. For updates on when contacts, calendars, and settings migration will be available, please keep an our blog and here.

Manually Migrating Calendars: You can manually migrate your calendar from atmail 7 into the atmail suite by using Apple Calendar. Guide can be found here.

 

Have more questions? Submit a request

Comments


Contact our support team


+61 (7) 5357 6605       support@atmail.com