February 8, 2010

 Migrating from IMail to Atmail 6

This document outlines the procedure for migrating your users and their email from the IMail email system into Atmail 6.x.x.

1. Scripts Used

The following scripts are used to complete an IMail to Atmail 6 migration:

/usr/local/atmail/webmail/utilities/migration/imail/migrate-imail.pl
/usr/local/atmail/webmail/utilities/migration/imail/import-users.php
/usr/local/atmail/webmail/utilities/migration/imail/migrate-abook.php
/usr/local/atmail/webmail/utilities/migration/imail/migrate-msgs.php

2. Procedure

1. Copy /usr/local/atmail/webmail/utilities/migration/imail/migrate-imail.pl to the IMail server

2. If you don't have Perl installed on the IMail server you will need to install it now

3. From the Windows command line move to the directory containing migrate-imail.pl and execute the following commands:

> perl migrate-imail.pl -users
> perl migrate-imail.pl -useraliases
> perl migrate-imail.pl -hostaliases

NOTE: You may need to type the full path to the "perl" binary.

Once these commands have completed you should have the following three files in the current working directory:

users.txt
useraliases.txt
hostaliases.txt

4. 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.

5. Move to the imail migration scripts directory on the Atmail server:

        # cd /usr/local/atmail/webmail/utilities/migration/imail

6. 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.

7. 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.

8. 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.:

/tmp/imail-data/domain-one.com
/tmp/imail-data/domain-two.com

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."/etc/imail-data/domain-two.com"

9. 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

10. 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

11. 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.

12. Sit back, have a beer and enjoy your new Atmail6 server!


Filed under: Migration, Atmail 6 — Brad Kowalczyk @ 9:05 pm

 

November 24, 2009

 Migrate SquirrelMail Address Book to Atmail 6.x.x

The following instructions are for migrating SquirrelMail Address Book contacts into Atmail 6. It will not import any user accounts, these must be created in Atmail 6 prior to running the address book migration script detailed in the article.

If you don't have Atmail 6.1.1 or above you will need to download this tgz and extract it into your Atmail web root before proceeding. For example, if your Atmail web root is /usr/local/atmail/webmail you would do # tar xvzf migrate-squirrelmail-abook.tgz -C /usr/local/atmail/webmail/

INSTRUCTIONS

NOTE: For the examples below the Atmail web root is /usr/local/atmail/webmail/. You should change this path to your actual location before running the commands (hint your web root is the folder that contains the index.php file)

1. # cd /usr/local/atmail/webmail/utilities/migration/

2. # php migrate-squirrelmail-abook.php  [squirrelmail_database_name] [sql_username:sql_password] [sql_hostname(optional)]

Bam that's it! All your users' address book contacts should now be migrated to their Atmail 6 Address Book.


Filed under: Migration, Atmail 6 — Brad Kowalczyk @ 6:02 pm

 

January 14, 2009

 Upgrading from Atmail Open to Atmail Commercial

Ok so you've tried Atmail Open and liked the experience but now want the full Atmail experience and have purchased the commercial version. Now you ask "how can I upgrade from Atmail Open to Atmail commercial and not loose all my users' data?" Well follow these simple steps and you'll quickly be on your way to running Atmail.

First of all you will need to make sure you are running the lastest version of Atmail Open so that you have the up to date version of the upgrade script. Then if you haven't already you will need to purchase and download the commercial version. You will then need to extract the files into place. Where you extract the files will depend on what version you purchased, server+client or client only.

If you have purchased the server+client version then extract the tgz into /usr/local, this will extract out the Atmail files under /usr/local/atmail.

If you have purchased the client only version then extract the files into your existing Atmail Open directory.

Once the files are extracted you need to run the upgrade2atmail.php script found in your Atmail Open directory, this script will make all necessary modifications to your Atmail Open database so it can be used by the commercial version:

# cd /path/to/atmailopen
# php upgrade2atmail.php

NB: This script can only be run from the command line and should only be run once you are ready to install Atmail commercial version.

Once the script has completed you should run the relevant installer for the version you purchased. If you purchased the client only version you may need to remove the .htaccess file from the install/ directory before you can run the web based installer.

Webmail client install instructions

Server version install instruction

Vital!: When you get to the database set up section be sure to select or enter the name of the database used by Atmail Open so that all your user info will be available

Migrating users (Server Version only)

If you are upgrading to the full Atmail server version then you will need to migrate your users and their email into the Atmail system. How to achieve this depends on the formats used by the old mail server. You will find info on migrating from many different mail systems here on the KB under the Migration category and also several migrate scripts can be found in your /usr/local/atmail/webmail/modules directory.


Filed under: Migration, Atmail 5 — Brad Kowalczyk @ 5:01 pm

 

June 25, 2008

 Migrating Imail to @Mail 5.0+ (PHP versions)

Migrating from IMail to @Mail 5.0+ (PHP versions) running under Linux is now possible with new PHP migration scripts (Note, we use the term 'Linux' but this article applies to any UNIX or UNIX like OS that can run @Mail Server 5.0+). The process requires various steps in order to migrate user-authentication data, system accounts, settings, messages and addressbook information into @Mail.To proceed follow the steps below:

1: First install @Mail on the new server or existing machine.

2: Download the Imail migration utilities from: http://atmail.com/attach/migrate-imail-php.tgz

3: Login to the server running Imail - Download ActivePerl from http://www.activestate.com/ and install Win32 Perl on your Imail server. This is required to run the migration script that pulls Imail data from the registry.

4: During the ActivePerl installation select to install under C:\perl\

5: Next, run the migrate-imail.pl script to dump the Imail database into a format @Mail can read. You can extract the file from your base @Mail installation webmail/modules/migrate-imail.pl or the archive given above, into directory C:/perl/

Usage: migrate-imail.pl [options]

Options:
-help            brief help message
-man             full documentation
-users           dump users
-useraliases     dump user aliases
-lists           dump lists
-domains         dump domains
-hostaliases     dump host aliases
-orphans         dump domains orphaned with no users

The script is designed to dump user account ( and decrypted passwords from the registry ) , aliases, lists, domains and
host-aliases

In order to migrate the data into @Mail run the migration script via the command-line as follows

cmd> cd C:/perl
cmd> C:/perl/bin/perl.exe migrate-imail.pl -users
cmd> C:/perl/bin/perl.exe migrate-imail.pl -useraliases
cmd> C:/perl/bin/perl.exe migrate-imail.pl -hostaliases
cmd> C:/perl/bin/perl.exe migrate-imail.pl -domains

These commands will create a text-file of the Imail database into a format @Mail can parse.

6: The next step is to migrate the exported data into @Mail. Copy the following files onto the new server running @Mail:

C:/perl/users.txt
C:/perl/useraliases.txt
C:/perl/hostaliases.txt
C:/perl/domains.txt

Copy the data into the pathname:

/usr/local/atmail/migrate/

7: Next, on the server running @Mail migrate the user data into @Mail by using the following commands:

cd /usr/local/atmail/webmail/modules/
php migrate-imail-import.php /usr/local/atmail/migrate/

This command will loop through each of the data dumps from Imail and import domains, users, aliases and host-aliases into the new @Mail system.

8: The next step is to migrate existing messages from Imail into @Mail.

Usage: php migrate-imail-msgs.php [directory of messages] [skip msgs older then X days]

Note you can optionally specify the number of days to ignore messages if they are older the X days

When migrating from Windows to Linux, you need to copy the entire Imail message store to the new server.

e.g C:\imail\domain.com -> Linuxserver:/usr/local/atmail/imail-data/

Once you have copied the Imail message store to the @Mail server perform the following commands:

cd /usr/local/atmail/webmail/modules/
php migrate-imail-msgs.php /usr/local/atmail/imail-data/

Note: This process picks up domain name and username from the directory structure of the Imail message store. The message store directory you copy to the @Mail server should have the following structure:

/usr/local/atmail/imail-data/domain_name/Users/username

Where domain_name is replaced by each domain the system hosts and username is replaced by each user under that domain. For example if Imail was hosting the accounts brad@mydomain.com, ben@mydomain.com, jason@anotherdom.com and john@anohterdom.com then these directories would exist:

/usr/local/atmail/imail-data/mydomain.com/Users/brad
/usr/local/atmail/imail-data/mydomain.com/Users/ben
/usr/local/atmail/imail-data/anotherdom.com/Users/jason
/usr/local/atmail/imail-data/anotherdom.com/Users/john
The command will recurse through these directories and migrate all existing folders, sub-folders and
messages for those users into @Mail. The @Mail account that the data is migrated to is decided by adding together the name of the username directory with the domain_name directory. So when reading

/usr/local/atmail/imail-data/mydomain.com/Users/brad

all messages and folders there will be migrated into the brad@mydomain.com account in @Mail.
9: Optionally you can migrate existing user addressbooks created via WebMail in Imail to @Mail.

Usage: php migrate-imail-abook.php [directory of users] [domain name]

Perform the following commands:

cd /usr/local/atmail/webmail/modules/
php migrate-imail-abook.php /usr/local/atmail/imail-data/ domain.com

10: Once you have completed the steps above the new system is live and ready to use! Login to the @Mail Webadmin -> Users -> List Users and you can login to existing accounts and select messages.

11: The next step is to disable Imail and activate @Mail

If migrating to a new machine move the DNS/MX records for all domains to point to the new @Mail server.
Existing users can login to POP3/IMAP without any changes to their desktop client. Existing users will need to be made aware of the new @Mail Webmail interface.

If you have any questions regarding the migration steps for Imail, please contact us. We also provide remote migration assistance for existing clients.


Filed under: Migration — Brad Kowalczyk @ 7:45 pm

 

January 1, 2008

 Hivemail to @Mail Migration Script

As per clients requests, we have developed a Hivemail to @Mail migration script.

This will sync over your existing users/data to the @Mail format. The scripts have been tested under Hivemail v1.3.1

The following data will be migrated:

* Users / Passwords
* Aliases
* User Settings
* Signatures
* Forwarders
* Folders
* Mailboxes ( all email messages )
* Contacts
* Groups

Instructions on how to migrate:

1: Install @Mail as per: http://support.atmail.com/server-install.html . Validate any existing SMTP/POP3 servers are disabled, these will be replaced with @Mail.

2: Copy the Hivemail mySQL database to the same machine running @Mail

3: Download the migration script at: http://calacode.com/members/migrate-hivemail2atmail.txt and place in the directory:

/usr/local/atmail/webmail/modules/migrate-hivemail2atmail.pl ( note the .pl extension )

4: Run the migration script

cd /usr/local/atmail/webmail/modules/
su atmail ( required for the permissions )perl migrate-hivemail2atmail.pl hive hivemailtest /path/to/mailboxes/

Where [hive] is the prefix of the tables, [hivemailtest] is the hivemail database name, and [/path/to/mailboxes] is the directory where raw email-messages are stored on the filesystem.

The following output will follow, for each user-account migrated:

Adding webmaster@domain.com - OK
Updating settings ...
Adding alias webmaster@domain.com ...
Adding signature ...
Adding folder Friends ...
Adding folder Family ...
Adding folder Personal ...
Adding folder Capella ...
Adding folder Notes ...
Copying message to Trash ( 2 kb )
Copying message to Trash ( 5 kb )
Adding user@yahoo.com to addressbook ...
Adding chase0gg603@hotmail.com to addressbook ...

The last step is to update the /usr/local/atmail/webmail/libs/Atmail/Auth.pm module to recognize the MD5 passwords used by Hivemail.

Locate the following lines and add the code in bold:

# If the password matches, update the LastLogin
if ( $db{Password} eq $self->{password} && !$pref{crypt} || $db{Password} eq $self->{password} && !$domains{ $self->{pop3host} } || crypt( $self->{password}, $db{Password} ) eq $db{Password} && $pref{crypt} || md5_hex($db{Password}) eq $self->{password} || $db{PasswordMD5} eq $self->{password} || md5_hex($self->{password}) eq $db{PasswordMD5}

Next, modify the following line and add the code in bold.

if ( $oldpass eq $pass || md5_hex($oldpass) eq $pass || crypt( $oldpass, $pass ) eq $pass && $pref{crypt} )

Congratulations, the migration is now complete. Any existing users can now login to the WebMail interface of @Mail.

To enable POP3/IMAP access users must login via WebMail and change their account password. This will modify the users password in the format for the POP3/IMAP authentication.

The Calacode team are available to assist data/user migration for users with the commerical version. Contact install@calacode.com for further details.


Filed under: Migration — Ben Duncan @ 12:00 pm

 

 Migrating Addressbook Data from Horde

How to migrate Horde/IMP Addressbook to @Mail:

For those of you moving to @Mail from a Horde system, welcome and enjoy! To help ease your transition from Horde here are simple little scripts that will import your user's address book entries from your old Horde database table into @Mail's.

Usage is simple, all you need is to have @Mail installed, your previous Horde database tables intact and your users migrated into @Mail.
Download the Horde addressbook migration script from:
http://atmail.com/attach/migrate-abook-horde.tgz

Place the scripts under /usr/local/atmail/webmail/modules/

Command usage is as follows:
php migrate-abook-horde.php [horde_db_name] [sql_user:user_pass] [sql_host(optional)]

horde_db_name: the name of the database used for Horde address book

sql_user: an sql username who has permissions on the database

user_pass: the password for above user (can be blank if no password)

sql_host: the hostname or IP of the server hosting the database
(note: if 'sql_host' is left blank 'localhost' is assumed)

So lets assume I have @Mail installed at /usr/local/atmail and my Horde database name is 'hordedb', my sql user with privileges on the database is 'hordeuser', the password is 'secret' and the database is hosted on 'localhost'. Here is how you would run the script:

# cd /usr/local/atmail/webmail/modules
# php migrate-abook-horde.php hordedb hordeuser:secret localhost

I could actually leave the 'localhost' bit off the end as this is presumed if no host is given.

Viewing records for username@mydomain.com
Added 'Ben Duncan'
Added 'Tihomir Nedyalkov'
Abook Migration complete.

Once complete users can login via the WebMail interface with their email-account, and all previous addressbook data will be available.


Filed under: Migration — info @ 12:00 pm

 

December 6, 2007

 Migrating from Surgemail to @Mail

@Mail now supports migrations from the SurgeMail Webmail platform. The migration script can import previous Address-book data, Distribution lists, and Tasks from the flat-file database used by Surgemail.

(more...)


Filed under: Migration, PHP version — info @ 3:13 pm

 

 Migrating cleartext user passwords to crypt password

Question:

I want to migrate from a clear text passwords of existed users to an encrypted passwords. Is this possible ? (more...)


Filed under: Encryption, Migration, PHP version — info @ 12:24 pm

 

August 3, 2007

 Migrating from Surgemail to @Mail

@Mail now supports migrations from the SurgeMail Webmail platform. The migration script can import previous Address-book data, Distribution lists, and Tasks from the flat-file database used by Surgemail.

The migration is seamless and all existing user data is available once logged into @Mail.

To use the migration script download a copy at:

http://atmail.com/attach/migrate-surgemail.tgz

This is provided in @Mail versions 5.08+ and greater by default.

Extract the migration scripts under:

/path/to/atmail/modules/

To execute:

cd /path/to/atmail/modules/
php migrate-surgemail.php /path/to/surgemail.csv

Where surgemail.csv is a list of users and the data directory location of user data.

The format of the CSV the file is:

user@domain.com,/path/to/surgemail/user/

To find the database location of a user under Surgemail you can use the inbuilt function to extract the database location:

cd /path/to/surgemail/
./webmail.cgi -show_path user@domain

Which will return a path similar to:

/var/spool/webmail/workarea/n_y2/a1/user_Pdomain_Icom_Plocalhost/

Use this utility to compile a CSV file for importing into @Mail

---

Once the script is run it will return each record migrated, for example:

# php migrate-surgemail.php /tmp/test.users
...
Migrating ben@domain.com

Reading /var/spool/webmail/workarea/n_y2/a1/user_Pdomain_Icom_Plocalhost/test.abk
        Added 'Max Pradella'
        Added 'Max Comparotto'
        Added 'Marcella Sanna' 

	Adding Group 'TestGroup' > user@domain.com - user@company.com - user@personal.com

Reading /var/spool/webmail/workarea/n_j7/z3/max_Ipradella_Poipaitalia_Icom_Plocalhost//todo.lst
        Added new Task Test migration
        Added new Task Do extra work
        Added new Task In the future todo
        Added new Task A task
...
SurgeMail Migration complete.

Filed under: Migration — Ben Duncan @ 11:02 am

 

June 20, 2007

 Migrate Squirrelmail Address Book to @Mail

For those of you moving to @Mail from a SquirrelMail system, welcome and enjoy! To help ease your transition from SquirrelMail here is a simple little script that will import your user's address book entries from your old SquirrelMail database table into @Mail's.Usage is simple, all you need is to have @Mail installed, your previous SquirrelMail database tables intact and your users migrated into @Mail.

(more...)


Filed under: Migration, PHP version — info @ 8:00 am