How can we help?




Follow

atmail suite upgrade guide

Dominic -

Purpose

To illustrate how to upgrade atmail suite to the latest version.

Pre-Upgrade Tasks

  1. Ascertain current version. The api and webmail packages will represent the current version of your suite.
    # rpm -qa | grep atmail-'webmail\|api'
    atmail-webmail-8.0.0-1.el7.centos.x86_64
    atmail-api-8.0.0-1.el7.centos.x86_64
  2. Backup database.
    # mysqldump -u root -p -d apiserver > apiserver-`rpm -qa atmail-api | sed 's/-/ /g' | awk '{print $3}'`_`date +"%Y%m%d"`.sql
  3. Backup both the apiserver and webmail. For your convenience the following command will create a suite-version_date.tgz
    # tar cfvz suite-`rpm -qa | grep atmail-webmail | sed 's/-/ /g' | awk '{print $3}'`_`date +"%Y%m%d"`.tgz apiserver[version_date].sql /etc/atmail/api /etc/atmail/webmail /etc/nginx/conf.d/atmail-api.locations /etc/nginx/conf.d/atmail-webmail.locations /var/lib/atmail/api /usr/share/atmail/webmail
    -rw-r--r--. 1 root root  1914825 Jul 21 17:04 suite-8.0.0_20170721.tgz

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

Download

Login to your pre-existing atmail customer portal account. Download the atmail mail server software package from within the atmail client portal.

 download_portal.png

Upgrade your atmail suite.

  1. Update to the latest base packages supplied by CentOS to ensure all the latest security and stability packages are applied:
  2. # yum update -y mariadb mariadb-server openssl openssl-libs exim nginx php php-fpm 
  3. Install redis:
    # yum install redis
  4. Extract the atmail-suite-rpm.tar.gz package.
    # tar xvzf atmail-suite-rpm.tar.gz
    RPM-GPG-KEY-atmail
    atmail-api-8.5.0-234.el7.centos.x86_64.rpm
    atmail-dav-8.5.0-234.el7.centos.x86_64.rpm
    atmail-common-1.0.0-1.el7.centos.x86_64.rpm
    atmail-webmail-8.5.0-233.el7.centos.x86_64.rpm
  5. Enter the atmail-suite directory.
    # cd atmail-suite-[version]
    [root@localhost atmail-suite-[version]]#
  6. Use yum to update the atmail-api rpm.
    # yum update atmail-api-[version].el7.centos.x86_64.rpm -y -q
  7. Stop the API server and perform a database schema update like so:
    # systemctl stop apiserver
    # apiserver -config /etc/atmail/api/api.conf --updatedb
    wait for the migrations to complete and hit Ctrl-C (^C) to exit, as all schema updates have been performed.
  8. Restart API service
    # systemctl restart apiserver
  9. Check the status of apiserver and ensure it is active and running.
  10. # systemctl status apiserver
    ● apiserver.service - atmail-api - jmap api for atmail webmail
    Loaded: loaded (/usr/lib/systemd/system/apiserver.service; enabled; vendor preset: disabled)
    Active: active (running) since Fri 2019-11-08 10:10:30 AEST; 2s ago
    Docs: http://www.atmail.com/
  11. Use yum to update the atmail-webmail rpm.
    # yum update atmail-webmail-[version].el7.centos.x86_64.rpm -y -q
  12. OPTIONAL: Use yum to install the atmail-dav rpm.
    # yum update atmail-dav-[version].el7.centos.x86_64.rpm -y -q
    Generating self-signed cert
  13. Restart services.
    systemctl restart php-fpm nginx
  14. atmail suite installation complete! Access your installation via your URL hostname slash webmail.
    https://yourhostname.com/login/

Troubleshooting

If you encounter any issues trying to restart your apiserver, use the following command to log to std out. The output below shows an example of an error occurring and how to remedy it.

# /usr/bin/apiserver -c /etc/atmail/api/api.conf -V -console
INFO[0000] Migrations path: /var/lib/atmail/api/resources/migrations/
INFO[0000] Migrations table found
INFO[0000] Migration file found: /var/lib/atmail/api/resources/migrations/1_V800_down.sql
INFO[0000] Migration file found: /var/lib/atmail/api/resources/migrations/1_V800_up.sql
INFO[0000] Migration file found: /var/lib/atmail/api/resources/migrations/2_V800_down.sql
INFO[0000] Migration file found: /var/lib/atmail/api/resources/migrations/2_V800_up.sql
INFO[0000] Migration file found: /var/lib/atmail/api/resources/migrations/3_V800_down.sql
INFO[0000] Migration file found: /var/lib/atmail/api/resources/migrations/3_V800_up.sql
INFO[0000] Invalid migration file found: /var/lib/atmail/api/resources/migrations/README
INFO[0000] Migrations file pairs found: 3
There are 1 schema changes waiting to be applied.
Please backup your database and re-run the apiserver with the flag --updatedb.

In referring to the case above, you can resolve this issue by performing the following:

  1. Backup your database.
    # mysqldump -u root -p -d apiserver > apiserver-`rpm -qa atmail-api | sed 's/-/ /g' | awk '{print $3}'`_`date +"%Y%m%d"`.sql
  2. Run the apiserver executable with the --updatedb argument and confirm the apiserver starts.
    # /usr/bin/apiserver -c /etc/atmail/api/api.conf --updatedb -V -console
    TRUNCATED OUTPUT...
    INFO[2017-10-09T18:50:58+11:00] atmail API server version: 8.2.0
    INFO[2017-10-09T18:50:58+11:00] Starting API Server Listening on 127.0.0.1:3000
    INFO[2017-10-09T18:50:58+11:00] Starting API Server Event Source Listening on 127.0.0.1:3001
  3. Once you can confirm functionality, start the service normally with systemd.
    # systemctl start apiserver
    # systemctl status apiserver
    ● apiserver.service - atmail-api - jmap api for atmail webmail
    Loaded: loaded (/usr/lib/systemd/system/apiserver.service; enabled; vendor preset: disabled)
    Active: active (running) since Mon 2017-10-09 18:51:12 AEDT; 3s ago
    Docs: http://www.atmail.com/
    Process: 3802 ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=1/FAILURE)
    Main PID: 3873 (apiserver)
    CGroup: /system.slice/apiserver.service
    └─3873 /usr/bin/apiserver -config /etc/atmail/api/api.conf
Have more questions? Submit a request

Comments


Contact our support team


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