doc/web/source/upgrade/0.4.x-0.5.rst
changeset 579 be0906181a10
equal deleted inserted replaced
578:20141b967c0b 579:be0906181a10
       
     1 ======================
       
     2 Upgrading to vmm 0.5.x
       
     3 ======================
       
     4 This page is valid only for vmm-0.4/vmm-0.4-r41 and vmm-0.5/vmm-0.5.1.
       
     5 If you are using vmm-0.3.x please upgrade first to
       
     6 `vmm-0.4-r41 <https://sourceforge.net/projects/vmm/files/vmm/0.4-r41>`_.
       
     7 
       
     8 Upgrading from vmm-0.4.x
       
     9 ------------------------
       
    10 Database backup
       
    11 ^^^^^^^^^^^^^^^
       
    12 It is always wise to back up your database from time to time.
       
    13 Particularly with regard to an impending structure modification.
       
    14 
       
    15 Example: Backing up the `mailsys` database with pg_dump_.
       
    16 
       
    17 .. code-block:: console
       
    18 
       
    19  root@host:~# pg_dump -h localhost -U vmm -W mailsys > mailsys-0.4.sql
       
    20 
       
    21 Stopping Postfix and Dovecot
       
    22 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       
    23 Before updating the database you have to stop Postfix and Dovecot.
       
    24 
       
    25 .. code-block:: console
       
    26 
       
    27  root@host:~# /etc/init.d/postfix stop
       
    28  Stopping Postfix Mail Transport Agent: postfix.
       
    29  root@host:~# /etc/init.d/dovecot stop
       
    30  Stopping IMAP/POP3 mail server: dovecot.
       
    31 
       
    32 Database update
       
    33 ^^^^^^^^^^^^^^^
       
    34 Connect as your `vmm` database user to your database.
       
    35 
       
    36 .. code-block:: console
       
    37 
       
    38  root@host:~# psql mailsys vmm -W -h localhost
       
    39 
       
    40 In the PostgreSQL interactive terminal you have to run the following
       
    41 commands to perform the update.
       
    42 
       
    43 .. code-block:: postgresql-console
       
    44 
       
    45  mailsys=> \i /path/to/vmm-0.5.2/update_tables_0.4.x-0.5.pgsql
       
    46  mailsys=> GRANT SELECT ON postfix_alias TO postfix;
       
    47  mailsys=> \q
       
    48 
       
    49 .. _database-update-for-dovecot-v1-2-x:
       
    50 
       
    51 Database update for Dovecot v1.2.x
       
    52 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       
    53 When you are already using Dovecot v1.2.x, you have to perform one or two
       
    54 **additional** database updates.
       
    55 
       
    56 .. code-block:: postgresql-console
       
    57 
       
    58  mailsys=> \i /path/to/vmm-0.5.2/update_tables_0.5.x_for_dovecot-1.2.x.pgsql
       
    59  mailsys=> GRANT SELECT ON dovecot_password TO dovecot;
       
    60  mailsys=> -- If you are using the function dovecotpassword() in the
       
    61  mailsys=> -- password_query setting of your dovecot-sql.conf update it also:
       
    62  mailsys=> \i /path/to/vmm-0.5.2/update_types_and_functions_0.5.x_for_dovecot-1.2.x.pgsql
       
    63  mailsys=> \q
       
    64 
       
    65 .. _adjusting-permissions-of-the-setuid-root-deliver-copy:
       
    66 
       
    67 Adjusting permissions of the setuid root deliver copy
       
    68 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       
    69 Starting with Dovecot version 1.2.0 the LDA ``deliver`` will no longer
       
    70 work, if the binary has the setuid-root bit set **and** it's executable
       
    71 for everyone.
       
    72 Independent of the directory permissions, where the ``deliver`` binary
       
    73 is located.
       
    74 For this reason you have to adjust the permission of the ``deliver`` binary.
       
    75 
       
    76 .. code-block:: console
       
    77 
       
    78  root@host:~# chown root:`id -g nobody` /usr/local/lib/dovecot/deliver
       
    79  root@host:~# chmod u+s,o-rwx /usr/local/lib/dovecot/deliver
       
    80 
       
    81 .. _check-update-postfix-master-cf:
       
    82 
       
    83 Check/update Postfix' master.cf
       
    84 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       
    85 In prior setups the service *dovecot* was configured slightly different.
       
    86 If you have set the command attribute user to ``nobody:mail``, either
       
    87 remove the group *mail* or replace it with the group *nobody* or *nogroup*.
       
    88 The second line of the service *dovecot* entry should look similar to this::
       
    89 
       
    90  flags=DORhu user=nobody argv=/usr/local/lib/dovecot/deliver …
       
    91 
       
    92 Start Dovecot and Postfix again
       
    93 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       
    94 After a successfully update start Dovecot and Postfix again.
       
    95 
       
    96 .. code-block:: console
       
    97 
       
    98  root@host:~# /etc/init.d/dovecot start
       
    99  Starting IMAP/POP3 mail server: dovecot.
       
   100  root@host:~# /etc/init.d/postfix start
       
   101  Starting Postfix Mail Transport Agent: postfix.
       
   102 
       
   103 Upgrade vmm
       
   104 ^^^^^^^^^^^
       
   105 Finally execute the ``upgrade.sh`` script to install the new code and
       
   106 update your ``/usr/local/etc/vmm.cfg``.
       
   107 
       
   108 .. code-block:: console
       
   109 
       
   110  root@host:~# cd /path/to/vmm-0.5.2
       
   111  root@host:/path/to/vmm-0.5.2# ./upgrade.sh
       
   112 
       
   113  Please have a look at your /usr/local/etc/vmm.cfg
       
   114  and verify the value from option 'postconf' in section 'bin'.
       
   115 
       
   116  root@host:/path/to/vmm-0.5.2#
       
   117 
       
   118 Upgrading from vmm-0.5.x
       
   119 ------------------------
       
   120 Upgrade vmm
       
   121 ^^^^^^^^^^^
       
   122 When you have already installed vmm-0.5 or vmm-0.5.1 only a single step is
       
   123 necessary to update your vmm installation.
       
   124 cd in the source directory and execute the ``upgrade.sh`` script.
       
   125 That's it.
       
   126 
       
   127 .. code-block:: console
       
   128 
       
   129  root@host:~# cd /path/to/vmm-0.5.2
       
   130  root@host:/path/to/vmm-0.5.2# ./upgrade.sh
       
   131  root@host:/path/to/vmm-0.5.2#
       
   132 
       
   133 When you are already using Dovecot ≧ v1.2.0, you should also respect
       
   134 following points:
       
   135 
       
   136  ‣ :ref:`database-update-for-dovecot-v1-2-x`
       
   137  ‣ :ref:`adjusting-permissions-of-the-setuid-root-deliver-copy`
       
   138  ‣ :ref:`check-update-postfix-master-cf`
       
   139 
       
   140 .. include:: ../ext_references.rst