My activities New request

contact atmail support

PH: +61 (7) 5357-6605

support@atmail.com

Follow

Atmail 6.X to Atmail 7.7.1 Server + WebMail Upgrade

Stewart -

PROBLEM
I'm not sure how to upgrade my Atmail 6 Server + WebMail install to Atmail 7.

ENVIRONMENT

  • On-Premise Server + WebMail Installations: Version 6.0 > 7.7.1

CAUSE
Atmail needs to be upgraded to the latest version.

RESOLUTION

In these instructions, replace [version] with your current version of Atmail.

Atmail 7.2+
PHP 5.3+ required for 7.2.0+

Backup

Before proceeding it is strongly recommended that you make a backup of your current Atmail installation:

mysqldump -u root -p atmail6 > /usr/local/atmail/atmail-6[version]-backup.sql
tar cfvz atmail-6[version]-backup.tgz /usr/local/atmail /etc/httpd/conf/httpd.conf /etc/init.d/atmailserver

This is required before you upgrade in case you need to roll-back any changes, do not skip this step.

Any customizations to Atmail (PHP, HTML, MTA-related code changes) must be backed up. The upgrade process will overwrite any modifications, and these must be merged in after the upgrade.

Preparing MySQL

Most Atmail 6 installations use the database name 'atmail6'. Do the following to transfer data from database 'atmail6' into a new database 'atmail7'.

Dump the MySQL database

mysqldump -u root -p atmail6 > /usr/local/atmail/atmail6-dump.sql

Import the Atmail database.

Log into MySQL and create new database 'atmail7' to insert the dump into.

mysql -u root -p
mysql> create database atmail7;

Log out of MySQL and import the dump into the 'atmail7' database.

mysql -u root -p atmail7 < /usr/local/atmail/atmail6-dump.sql

Stop Atmail Services

Stop Atmail services.

/etc/init.d/atmailserver stop

Update Atmail MySQL Settings

Open and edit /usr/local/atmail/webmail/config/dbconfig.ini

Locate:

database.params.dbname   = "atmail6"

Change To:

database.params.dbname   = "atmail7"

Open and edit /usr/local/atmail/mailserver/configure

Locate:

hide mysql_servers = 127.0.0.1/atmail6/user/pass

Change To:

hide mysql_servers = 127.0.0.1/atmail7/user/pass

Open and edit /usr/local/atmail/mailserver/etc/dovecot-sql.conf

Locate:

connect = host=127.0.0.1 dbname=atmail6 user=user password=pass

Change To:

connect = host=127.0.0.1 dbname=atmail7 user=user password=pass

Open and edit /usr/local/atmail/mailserver/etc/dovecot-users-sql.conf

Locate:

connect = host=127.0.0.1 dbname=atmail6 user=user password=pass

Change To:

connect = host=127.0.0.1 dbname=atmail7 user=user password=pass

Start Atmail Services

Start Atmail services.

/etc/init.d/atmailserver start

Upgrade atmail 6.20.3 > atmail 6.6.6

  1. If you are running version 6.20.3 or older, you will need to upgrade to the latest atmail 6 version first. If you running a newer version of atmail 6 than 6.20.3, you can skip the upgrade to atmail 6.6.6 and go striaght to the next section, Upgrade atmail 6.6.6 > atmail 7.1.5.
  2. Download the latest Atmail 6 tarball via the following URL.
    http://download.atmail.com/atmail6.mailserver.tgz
  3. Extract the software out into the directory for Atmail
    tar xfvz atmail6.mailserver.tgz -C /usr/local/
  4. You will now need to give Atmail correct permissions.
    chown atmail:atmail /usr/local/atmail/;
    chown -R atmail:atmail /usr/local/atmail/webmail;
    cd /usr/local/atmail/webmail/;
    find . -name .htaccess -exec chown root:root {} \;
    find . -name .htaccess -exec chmod 644 {} \;
  5. RPM/Appliance Install ONLY:
    mv /usr/local/atmail/mailserver/bin/atmail-update-version /usr/local/atmail/mailserver/bin/atmail-update-version.off
  6. Visit the WebAdmin of Atmail and use the Update software link. This will guide you through the web-based upgrade utility for the database schema updates and config changes:

    e.g http://server.com/mail/index.php/admin/

    Where server.com/mail/index.php is the URL of the Atmail software on your server. Login to Web Administration using your admin username/password, then click the License tab > Update software.

  7. Depending on the software update, additional packages may need to be re-installed or re-compiled if you are using the Email Server version of Atmail. If prompted during the Web Admin upgrade, run the additional upgrade utility from a command-line:
    cd /usr/local/atmail/ 
    php server-update.php

Upgrade atmail 6.6.6 > atmail 7.1.5

  1. Download the atmail 7.1.5 tarball via the following URL.
    http://download.atmail.com/old-releases/atmail7.1.5.mailserver.tgz
  2. Extract the software out into the directory for Atmail
    tar xfvz atmail7.1.5.mailserver.tgz -C /usr/local/
  3. You will now need to give Atmail correct permissions.
    chown atmail:atmail /usr/local/atmail/;
    chown -R atmail:atmail /usr/local/atmail/webmail;
    cd /usr/local/atmail/webmail/;
    find . -name .htaccess -exec chown root:root {} \;
    find . -name .htaccess -exec chmod 644 {} \;
  4. RPM/Appliance Install ONLY:
    mv /usr/local/atmail/mailserver/bin/atmail-update-version /usr/local/atmail/mailserver/bin/atmail-update-version.off
  5. Visit the WebAdmin of Atmail and use the Update software link. This will guide you through the web-based upgrade utility for the database schema updates and config changes:

    e.g http://server.com/mail/index.php/admin/

    Where server.com/mail/index.php is the URL of the Atmail software on your server. Login to Web Administration using your admin username/password, then click the License tab > Update software.

  6. Depending on the software update, additional packages may need to be re-installed or re-compiled if you are using the Email Server version of Atmail. If prompted during the Web Admin upgrade, run the additional upgrade utility from a command-line:
    cd /usr/local/atmail/ 
    php server-update.php

Upgrade atmail 7.1.5 > atmail 7.4.0

  1. Download the latest atmail 7.4.0 tarball via the following URL.
    http://download.atmail.com/old-releases/atmail-7.4.0-mailserver.tgz
  2. Extract the software out into the directory for Atmail
    tar xfvz atmail-7.4.0-mailserver.tgz -C /usr/local/
  3. You will now need to give Atmail correct permissions.
    chown atmail:atmail /usr/local/atmail/;
    chown -R atmail:atmail /usr/local/atmail/webmail;
    cd /usr/local/atmail/webmail/;
    find . -name .htaccess -exec chown root:root {} \;
    find . -name .htaccess -exec chmod 644 {} \;
  4. RPM/Appliance Install ONLY:
    mv /usr/local/atmail/mailserver/bin/atmail-update-version /usr/local/atmail/mailserver/bin/atmail-update-version.off
  5. Visit the WebAdmin of Atmail and use the Update software link. This will guide you through the web-based upgrade utility for the database schema updates and config changes:

    e.g http://server.com/mail/index.php/admin/

    Where server.com/mail/index.php is the URL of the Atmail software on your server. Login to Web Administration using your admin username/password, then click the License tab > Update software.

  6. Depending on the software update, additional packages may need to be re-installed or re-compiled if you are using the Email Server version of Atmail. If prompted during the Web Admin upgrade, run the additional upgrade utility from a command-line:
    cd /usr/local/atmail/ 
    php server-update.php

Upgrade atmail 7.4.0 > atmail 7.5.0.2

  1. Download the latest atmail 7.5.0.2 tarball via the following URL.
    http://download.atmail.com/old-releases/atmail7.5.0.2.mailserver.tgz
  2. Extract the software out into the directory for Atmail
    tar xfvz atmail7.5.0.2.mailserver.tgz -C /usr/local/
  3. You will now need to give Atmail correct permissions.
    chown atmail:atmail /usr/local/atmail/;
    chown -R atmail:atmail /usr/local/atmail/webmail;
    cd /usr/local/atmail/webmail/;
    find . -name .htaccess -exec chown root:root {} \;
    find . -name .htaccess -exec chmod 644 {} \;
  4. RPM/Appliance Install ONLY:
    mv /usr/local/atmail/mailserver/bin/atmail-update-version /usr/local/atmail/mailserver/bin/atmail-update-version.off
  5. Visit the WebAdmin of Atmail and use the Update software link. This will guide you through the web-based upgrade utility for the database schema updates and config changes:

    e.g http://server.com/mail/index.php/admin/

    Where server.com/mail/index.php is the URL of the Atmail software on your server. Login to Web Administration using your admin username/password, then click the License tab > Update software.

  6. Depending on the software update, additional packages may need to be re-installed or re-compiled if you are using the Email Server version of Atmail. If prompted during the Web Admin upgrade, run the additional upgrade utility from a command-line:
    cd /usr/local/atmail/ 
    php server-update.php


Upgrade atmail 7.5.0.2 > atmail 7.7.1

  1. Download the latest atmail 7.7.1 tarball via the following URL.
    http://download.atmail.com/old-releases/atmail.7.7.1.mailserver.tgz
  2. Extract the software out into the directory for Atmail
    tar xfvz atmail7.7.1.mailserver.tgz -C /usr/local/
  3. You will now need to give Atmail correct permissions.
    chown atmail:atmail /usr/local/atmail/;
    chown -R atmail:atmail /usr/local/atmail/webmail;
    cd /usr/local/atmail/webmail/;
    find . -name .htaccess -exec chown root:root {} \;
    find . -name .htaccess -exec chmod 644 {} \;
  4. RPM/Appliance Install ONLY:
    mv /usr/local/atmail/mailserver/bin/atmail-update-version /usr/local/atmail/mailserver/bin/atmail-update-version.off
  5. Visit the WebAdmin of Atmail and use the Update software link. This will guide you through the web-based upgrade utility for the database schema updates and config changes:

    e.g http://server.com/mail/index.php/admin/

    Where server.com/mail/index.php is the URL of the Atmail software on your server. Login to Web Administration using your admin username/password, then click the License tab > Update software.

  6. Depending on the software update, additional packages may need to be re-installed or re-compiled if you are using the Email Server version of Atmail. If prompted during the Web Admin upgrade, run the additional upgrade utility from a command-line:
    cd /usr/local/atmail/ 
    php server-update.php
  7. Congratulations, the upgrade is now complete. You can now reload the Webmail interface of Atmail and begin using the latest release and features.If you've made any customizations to the HTML templates, images, or source-code, these changes will need to be copied back in after the upgrade. We recommend using the “diff” command-line utility to compare any local customizations to the latest version.

Post-Upgrade (Version 7.x to 7.5.2+)

How to upgrade from version 7.x to 7.5.2+ and have your logs in a different database.

One of the improvements within atmail version 7.5.2 is the option to store logs in a different database. However, it’s important to note that this option is only offered for configuration by default during fresh installs.

If you are upgrading your environment from a previous version of atmail and want to take advantage of this improvement, the following manual steps will be required, as a post upgrade procedure:

  1. Create a new database specifically for logs. i.e atmail_logs on the same or different MySQL server.
  2. Populate the new database using

    /usr/local/atmail/webmail/install/atmail7-logs.sql

    --
    -- Table structure for table `Log_Error`
    --
    
    CREATE TABLE `Log_Error` (
      `LogMsg` varchar(255) default NULL,
      `LogDate` datetime default NULL,
      `Account` varchar(128) NOT NULL default '',
      `id` bigint(12) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`),
      KEY `iAccount` (`Account`),
      KEY `LogDate` (`LogDate`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    --
    -- Table structure for table `Log_Login`
    --
    
    CREATE TABLE `Log_Login` (
      `LogDate` datetime default NULL,
      `LogType` tinyint(1) default NULL,
      `LogIP` int(10) UNSIGNED DEFAULT NULL,
      `Account` varchar(128) default NULL,
      `id` bigint(12) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`),
      KEY `iAccount` (`Account`),
      KEY `iLogType` (`LogType`),
      KEY `iLogIP` (`LogIP`),
      KEY `LogDate` (`LogDate`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    --
    -- Table structure for table `Log_RecvMail`
    --
    
    CREATE TABLE `Log_RecvMail` (
      `LogDate` datetime default NULL,
      `LogIP` int(10) UNSIGNED DEFAULT NULL,
      `EmailFrom` varchar(128) default NULL,
      `MessageID` varchar(16) default NULL,
      `Account` varchar(128) NOT NULL default '',
      `id` bigint(12) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`),
      KEY `iAccount` (`Account`),
      KEY `iLogIP` (`LogIP`),
      KEY `LogDate` (`LogDate`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    --
    -- Table structure for table `Log_SendMail`
    --
    
    CREATE TABLE `Log_SendMail` (
      `LogDate` datetime default NULL,
      `LogIP` int(10) UNSIGNED DEFAULT NULL,
      `EmailTo` varchar(128) default NULL,
      `MessageID` varchar(16) default NULL,
      `Account` varchar(128) NOT NULL default '',
      `id` bigint(12) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`),
      KEY `iAccount` (`Account`),
      KEY `iLogIP` (`LogIP`),
      KEY `LogDate` (`LogDate`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    --
    -- Table structure for table `Log_Spam`
    --
    
    CREATE TABLE `Log_Spam` (
      `LogDate` datetime default NULL,
      `LogType` tinyint(1) default NULL,
      `LogIP` int(10) UNSIGNED DEFAULT NULL,
      `SpamPoints` smallint(2) default NULL,
      `EmailFrom` varchar(128) default NULL,
      `Account` varchar(128) NOT NULL default '',
      `id` bigint(12) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`),
      KEY `iAccount` (`Account`),
      KEY `iLogIP` (`LogIP`),
      KEY `LogDate` (`LogDate`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    --
    -- Table structure for table `Log_Virus`
    --
    
    CREATE TABLE `Log_Virus` (
      `LogDate` datetime default NULL,
      `LogIP` int(10) UNSIGNED DEFAULT NULL,
      `EmailFrom` varchar(128) default NULL,
      `VirusName` varchar(128) default NULL,
      `Account` varchar(128) NOT NULL default '',
      `id` bigint(12) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`),
      KEY `iAccount` (`Account`),
      KEY `LogDate` (`LogDate`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    --
    -- Table structure for table `Log_Device`
    --
    
    CREATE TABLE `Log_Device` (
      `LogDate` datetime default NULL,
      `LogIP` int(10) UNSIGNED DEFAULT NULL,
      `DeviceID` varchar(128) default NULL,
      `DeviceType` varchar(128) default NULL,
      `Account` varchar(128) default NULL,
      `id` bigint(12) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`),
      KEY `iAccount` (`Account`),
      KEY `iDeviceID` (`DeviceID`),
      KEY `iDeviceType` (`DeviceType`),
      KEY `LogDate` (`LogDate`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    --
    -- Table structure for table `Log_Count_Cache`
    --
    
    CREATE TABLE `Log_Count_Cache` (
      `LogTable` varchar(128) default NULL,
      `LogCount` bigint(12) unsigned NOT NULL,
      `Timestamp` datetime default NULL,
      `id` bigint(12) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  3. Edit and add a new logging section in webmail/config/dbconfig.ini.
    Example
    [production]
    database.adapter = pdo_mysql
    database.params.host = "127.0.0.1"
    database.params.username = "user"
    database.params.password = "password"
    database.params.dbname = "atmail7"
    database.params.configtable = Config
    database.params.masterkey = "MASTERKEY"
    [logging]
    database.adapter = pdo_mysql
    database.params.host = "127.0.0.1"
    database.params.username = "user"
    database.params.password = "password"
    database.params.dbname = "atmail7_logs"
    database.params.configtable = Config
    database.params.masterkey = "MASTERKEY"
  4. Update exim configure and add a new mysql server for logs and update the mysql lookups call.
    • Add a new mysql server:
      hide mysql_servers = 127.0.0.1/MY_ATMAIL_DATABASE/user/password:\
      127.0.0.1/MY_ATMAIL_LOGS_DATABASE/user/password
    • Replace all mysql lookups for main queries from:
      lookup mysql{... 
      to
      lookup mysql{servers=127.0.0.1/MY_ATMAIL_DATABASE/user/password; ...
    • Replace mysql lookup for the single log query from:
      lookup mysql{MYSQL_SENDLIMIT ... 
      to
      lookup mysql{servers=127.0.0.1/MY_ATMAIL_LOGS_DATABASE/user/password; MYSQL_SENDLIMIT ...

Post-Upgrade (Version 7.x to 7.6+)

Two scripts need to be run (after the successful upgrade and services are back online).

  • Bayes:

    Atmail 7.6 includes improved Bayes filtering, but for this to be effective the previous Bayes DB must be purged and message re-synced to learn spam/non-spam messages. Post upgrade, run the bayes-resync.php script in the background to update SpamAssassin.
    php /usr/local/atmail/webmail/utilities/tools/bayes-resync.php
  • ClamAV:

    Additionally, the ClamAV anti-virus system has been updated with improved virus signatures. It is recommended to scan the entire email filesystem, and automatically detect and remove virus emails which exist in a users mailbox.

    Run:
    /usr/local/atmail/av/bin/clamscan -v -r --scan-mail /usr/local/atmail/users/ --move=/tmp/clam/
    Any emails detected with a virus will be automatically removed from the users mailbox, and placed in /tmp/clam/.

    After analyzing the folder, it is recommended that it be removed from the filesystem.

Troubleshooting

Spamassassin Upgrade

Atmail 7.6+ includes an upgraded version of spamassassin. If when running the php script, server-update.php, and it hangs at the following section, you will have missing dependencies.

==> Found dependencies: HTTP::Status, HTTP::Response, HTTP::Request
--> Working on Net::HTTP
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Net-HTTP-6.09.tar.gz ... OK
Configuring Net-HTTP-6.09 ... OK

To resolve, install the following modules via mcpan.

  • IO::Socket::INET6
  • IO::Socket::SSL
  • Compress::Zlib

Perl has a module called CPAN with which one can install CPAN modules along with all of the modules they depend on. To invoke it type perl -MCPAN -e shell at the command line while being a super-user, and follow the instructions it gives you. The install command can be used to automatically install modules.

install IO::Socket::INET6

Force Re-Run Upgrade

If you run into any troubles with the upgrade you may need to re-run the upgrade process.

Assuming that your last version was 6.30.1; Login to your Atmail database and execute the following command.

mysql> update Config set keyValue = "6.30.1" where keyName = "version";

This will fool the WebAdmin update scripts and enable re-running the sql schema updates via the WebAdmin > License > Update Software.

Following the success of the WebAdmin update, please then execute the server-update.php file as the update page will instruct you.

php server-update.php 6.30.1

Licensing Issues

No available license seats. Please add more seats.

Clients upgrading from Atmail 6 to Atmail 7 may experience this error message upon installation:
No available license seats. Please add more seats.

If you experience this issue, please go to WebAdmin > Settings > Global Settings, and click on Save Settings (as per the following screenshot):

Doing so should fix the issue.

Error: License Invalid or No License Installed.

Clients upgrading from Atmail 6 to Atmail 7 may experience this error message upon installation:

Error: License Invalid or No License Installed.

If you experience this issue, please the following command via MySQL:

mysql>select licenseType from Groups;

Example.

mysql> select licenseType from Groups;
 
+-------------+
| licenseType |
+-------------+
|           0 |
|           0 |
|           0 |
|           0 |
|           0 |
|           5 |
|           0 |
+-------------+

Note that '0' is not a vaild licenseType. To resolve, update licenseType to match your license.

Example.

mysql> update Groups set licenseType='5';
Have more questions? Submit a request

Comments