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

atmail dav upgrade guide

Dominic -

PROBLEM

How can I upgrade my atmail dav software?

ENVIRONMENT

  • atmail suite

CAUSE

atmail dav needs to be upgraded to the latest version.

RESOLUTION

Keeping your atmail installation up-to-date should be prioritized so your system can benefit from our latest technologies and security features. You can find all the latest and greatest changes in the changelog.

Pre-Upgrade Tasks

  1. Ascertain current version. The atmail-dav package will represent the current version of your suite.
    [root@a8 ~]# rpm -qa | grep dav
    atmail-dav-1.0.1-1.el7.centos.x86_64
  2. Backup dav database.
    [root@a8 ~]# # mysqldump -u root -p -d davserver > davserver-`rpm -qa | grep atmail-dav | sed 's/-/ /g' | awk '{print $3}'`_`date +"%Y%m%d"`.sql
  3. Backup dav. For your convenience the following command will create a dav-version_date.tgz
    [root@a8 ~]# tar cfvz dav-`rpm -qa | grep atmail-dav | sed 's/-/ /g' | awk '{print $3}'`_`date +"%Y%m%d"`.tgz davserver-[version_date].sql /etc/atmail/dav /etc/nginx/conf.d/atmail.conf /etc/nginx/conf.d/atmail-dav.conf /usr/share/atmail/dav
    -rw-r--r--. 1 root root 1914825 Jul 21 17:04 dav-1.0.1_20171006.tgz

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

Upgrade your atmail suite.

  1. You can download your latest atmail dav by directly accessing your customer portal.
  2. Extract the atmail-dav-rpm.tar.gz package.
    [root@a8 ~]# tar xvfz atmail-dav-rpm.tar.gz 
    atmail-dav-[version]/
    atmail-dav-[version]/atmail-dav-[version].el7.centos.x86_64.rpm
    atmail-dav-[version]/RPM-GPG-KEY-atmail
    atmail-dav-[version]/atmail-common-[version].el7.centos.x86_64.rpm
  3. Enter the atmail-dav directory.
    [root@a8 ~]# cd atmail-dav-[version]/
    [root@a8 atmail-dav-[version]]#
  4. Update your dav rpm using yum.
    [root@a8 atmail-dav-[version]]# yum upgrade atmail-dav-[version].el7.centos.x86_64.rpm 
    Loaded plugins: fastestmirror
    Examining atmail-dav-[version].el7.centos.x86_64.rpm: atmail-dav-[version].el7.centos.x86_64
    Marking atmail-dav-[version].el7.centos.x86_64.rpm as an update to atmail-dav-[version].el7.centos.x86_64
    Resolving Dependencies
    --> Running transaction check
    ---> Package atmail-dav.x86_64 0:[version].el7.centos will be updated
    ---> Package atmail-dav.x86_64 0:[version].el7.centos will be an update
    --> Finished Dependency Resolution

    Dependencies Resolved
    =====================================================================================================================================================================================================================
    Package Arch Version Repository Size
    =====================================================================================================================================================================================================================
    Updating:
    atmail-dav x86_64 [version].el7.centos /atmail-dav-[version].el7.centos.x86_64 6.5 M

    Transaction Summary
    =====================================================================================================================================================================================================================
    Upgrade 1 Package

    Total size: 6.5 M
    Is this ok [y/d/N]: y
    Downloading packages:
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
    Updating : atmail-dav-[version].el7.centos.x86_64 1/2
    To complete upgrade cd /usr/share/atmail/dav and run /usr/bin/atmail-dav-update.php
    Cleanup : atmail-dav-[version].el7.centos.x86_64 2/2
    Verifying : atmail-dav-[version].el7.centos.x86_64 1/2
    Verifying : atmail-dav-[version].el7.centos.x86_64 2/2

    Updated:
    atmail-dav.x86_64 0:[version].el7.centos

    Complete!
  5. Change into the following directory and run the required script to complete the installation.
    [root@a8 atmail-dav-[version]]# cd /usr/share/atmail/dav
    [root@a8 dav]# php /usr/bin/atmail-dav-update.php 
    SabreDAV migrate script for version 3.2
    Connecting to database: mysql:host=localhost;dbname=davserver
    Detected MySQL.
    Creating 'calendarinstances'
    calendarinstances does not yet exist. Creating table and migrating data.
    The calendars table has 11 columns.
    Backing up 'calendars' to 'calendars_3_1_1507533786'
    Creating new calendars table.
    Migrating data from old to new table
    Upgrade to 3.2 schema completed.
    Found 1 updates.
    Applying /usr/share/atmail/dav/schema/1_101.sql...
    # quota for users, currently defaults to 1GB
    CREATE TABLE quota (
    userid INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    total BIGINT UNSIGNED NOT NULL DEFAULT 1073741824,
    used BIGINT UNSIGNED NOT NULL DEFAULT 0,
    lastUpdated TIMESTAMP NOT NULL DEFAULT 0
    )
    ENGINE = InnoDB
    DEFAULT CHARSET = utf8mb4
    # version tracking
    CREATE TABLE version (
    version INTEGER UNSIGNED NOT NULL PRIMARY KEY DEFAULT 0
    )
    ENGINE = InnoDB
    DEFAULT CHARSET = utf8mb4
    # current version
    INSERT INTO version VALUES (1)
    # modify users table to add password hash support for atmail
    ALTER TABLE users
    CHANGE digesta1 digesta1 VARCHAR(256) DEFAULT NULL
    UPDATE users
    SET digesta1 = CONCAT("{DIGESTA1}", digesta1)
    ALTER TABLE users
    CHANGE digesta1 password VARCHAR(256) DEFAULT NULL
    # add unique index to cards similar to calendarobjects to stop duplicates.
    ALTER IGNORE TABLE cards
    ADD UNIQUE INDEX owner_uri_uk (addressbookid, uri)
    Done.

    **Please check update notes for configuration changes.
  6. Finally, restart nginx and php-fpm.

    [root@a8 dav]# systemctl restart php-fpm nginx
  7. Use to the following command to confirm you are now running your latest version of atmail-dav.
    [root@turtle ~]# rpm -qa | grep dav
    atmail-dav-[version].el7.centos.x86_64
Have more questions? Submit a request

Comments


Contact our support team


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