Dovecot upgrade to Wheezy

Discussion in 'General' started by SamTzu, Jun 17, 2013.

  1. SamTzu

    SamTzu Member HowtoForge Supporter

    I just tried a test upgrade from Squeezy to Wheezy on our ISPconfig3 mail server and it was an epic fail. Any one got this working? I could use some pointers.

    Apparently the changes in Dovecot are major and manual changes in configuration files are needed.

     
    Last edited: Jun 17, 2013
  2. ressel

    ressel Member

    Hello,

    What I did when I got this message was to delete dovecot completely by using purge, And then install it again, and follow the perfect server guide.
    This may not be the best way to solve it, but it worked for me.
     
  3. SamTzu

    SamTzu Member HowtoForge Supporter

    And the existing users :)
     
  4. jrklein

    jrklein New Member

    Dovecot Upgrade from Debian 6 (Squeeze) to Debian 7 (Wheezy)

    SamTzu,

    When you upgrade from Debian 6 (Squeeze) to Debian 7 (Wheezy), you are also performing a major upgrade from Dovecot 1.2.x to Dovecot 2.1.x. This upgrade DOES require manual intervention. I upgraded several ISPconfig Dovecot/Postfix mail servers over the weekend. Each upgrade took about 15-20 minutes. Total downtime per mail server was less than 5 minutes. I did NOT recreate any mailboxes or modify the ISPconfig database in any way.

    I recommend reading the Debian 7 release notes in their entirety before upgrading. I had to upgrade many servers with various configurations. The notes help us prepare for upgrades to prevent several issues and also helped us to quickly resolve several issues after the upgrades.

    http://www.debian.org/releases/stable/i386/release-notes/


    I also suggest reading Falko's upgrade notes for ISPconfig servers. These are the minimum commands you need to run for an upgrade. If your server has minimal (or no) custom configuration, this may be all you need to do.

    http://www.howtoforge.com/how-to-upgrade-debian-squeeze-to-wheezy


    Here are the highlights from my Debian 6 to Debian 7 ISPconfig mail server upgrade notes.

    # Backup existing Dovecot 1.x configuration
    cp -a /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.1x-backup

    # Update lists of available packages
    apt-get update

    # Minimal system upgrade
    apt-get upgrade

    # Distribution upgrade
    apt-get dist-upgrade

    Since I had already made a backup of my original Dovecot 1.x configuration file, I told Debian to install the new Dovecot 2.x configuration files. Even so, the upgrade stopped with Dovecot related errors. I then performed these steps before resuming dist-upgrade:

    # Backup vanilla Dovecot 2.x configuration (for future reference)
    cp -a /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.2x-vanilla

    # Duplicate backup of our original Dovecot 1.x configuration
    cp -a /etc/dovecot/dovecot.conf.1x-backup /etc/dovecot/dovecot.conf.1x-backup-modified

    # Dovecot 2.x uses different mail plugin directory. Update setting in copy of original configuration file.
    # BEFORE: mail_plugin_dir = /usr/lib/dovecot/modules/lda
    # AFTER: mail_plugin_dir = /usr/lib/dovecot/modules
    sed -i 's#mail_plugin_dir = /usr/lib/dovecot/modules/lda#mail_plugin_dir = /usr/lib/dovecot/modules#g' /etc/dovecot/dovecot.conf.1x-backup-modified

    # NOTE: If you do not correct mail_plugin_dir, you will receive the following ERROR from doveconf:
    # doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf.1x-backup: mail_plugin_dir: access(/usr/lib/dovecot/modules/lda) failed: No such file or directory

    # Migrate our modified Dovecot 1.x configuration to running Dovecot 2.x configuration
    # Upgrading Dovecot 1.x to Dovecot 2.x: http://wiki2.dovecot.org/Upgrading/2.0
    doveconf -n -c /etc/dovecot/dovecot.conf.1x-backup-modified > /etc/dovecot/dovecot.conf

    # Restart Dovecot 2.x service
    /etc/init.d/dovecot restart

    # Restart Postfix service
    /etc/init.d/postfix restart

    # If you receive this warning during Postfix restart...
    # /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: smtpd_bind_address=127.0.0.1
    # ... then you may need to comment out this line near the end of /etc/postfix/master.cf:
    # -o smtpd_bind_address=127.0.0.1


    # Distribution upgrade (again to finish installing updates)
    apt-get dist-upgrade

    # NOTE: When you run dist-upgrade again, you may be told that the Dovecot package upgrade is still pending. You will be instructed to run "apt-get -f install" (or similar) to resolve the issue. Run the command as shown and then run "apt-get dist-upgrade" again to complete the distribution upgrade.


    Dovecot Upgrade Comments:

    During the OS upgrade, I allowed Debian 7 to overwrite my Dovecot 1.x configuration file with Dovecot 2.x configuration files. Dovecot 2.1.x had changed the syntax of several configuration options and moved most configuration items from "/etc/dovecot/dovecot.conf" into split configuration files in "/etc/dovecot/conf.d/*".

    The "doveconf" program WILL display several warnings that explain syntax changes. It seems doveconf was able to handle all change except the mail_plugin_dir change above. I was able to disregard all doveconf warnings. Save a copy of these warnings for future reference.

    The "doveconf" program created a single Dovecot configuration file and did NOT create the new split configuration files. You may want to backup/delete the unused split configuration files to prevent confusion in the future.

    I tried to determine if ISPconfig would prefer a single configuration file or split configuration files, but I was unable to find any references to dovecot.conf in the source code. I assume ISPconfig will expect a single Dovecot configuration file if it attempts to modify the configuration.


    HTH, Jason

    Was this helpful? Tips appreciated! Bitcoin: 1GkkJaBUqWTpL8F7XiLnPVpd3oT8N9Nkrp
     
    Last edited by a moderator: Jan 10, 2015

Share This Page