doc/web/source/upgrade/0.5-0.6.rst
author Pascal Volk <user@localhost.localdomain.org>
Sun, 13 Jan 2013 15:26:37 +0000
branchv0.7.x
changeset 682 697350dd9369
parent 626 f151defe7078
child 706 6c369b680ab0
permissions -rw-r--r--
doc/web: Updated to reflect the new cli.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
579
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     1
======================
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     2
Upgrading to vmm 0.6.x
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     3
======================
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     4
This document describes the procedure to upgrade a vmm-0.5.2 installation
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     5
to version 0.6.x
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     6
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     7
If you still have installed vmm-0.4/vmm-0.4-r41 you have to proceed this
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     8
step first:
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
     9
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    10
:doc:`0.4.x-0.5`
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    11
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    12
Upgrading from vmm-0.5.2
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    13
------------------------
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    14
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    15
Stop Postfix and Dovecot
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    16
^^^^^^^^^^^^^^^^^^^^^^^^
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    17
Before updating your database layout you have to stop Postfix and Dovecot.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    18
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    19
.. code-block:: console
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    20
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    21
 root@host:~# /etc/init.d/postfix stop
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    22
 Stopping Postfix Mail Transport Agent: postfix.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    23
 root@host:~# /etc/init.d/dovecot stop
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    24
 Stopping IMAP/POP3 mail server: dovecot.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    25
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    26
Create a database backup
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    27
^^^^^^^^^^^^^^^^^^^^^^^^
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    28
It is always wise to back up your database from time to time.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    29
Particularly with regard to an impending structure modification.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    30
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    31
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    32
Example: Backing up the `mailsys` database with pg_dump_.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    33
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    34
.. code-block:: console
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    35
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    36
 user@host:~$ pg_dump -h localhost -U vmm -W mailsys > mailsys-0.5.2.sql
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    37
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    38
Database update
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    39
^^^^^^^^^^^^^^^
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    40
Connect as your `vmm` database user to your database.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    41
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    42
.. code-block:: console
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    43
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    44
 user@host:~$ psql mailsys vmm -W -h localhost
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    45
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    46
In the PostgreSQL interactive terminal you have to run one of the following
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    47
commands to perform the update.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    48
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    49
Dovecot v1.2.x/v2.0.x/v2.1.x
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    50
""""""""""""""""""""""""""""
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    51
.. code-block:: postgresql-console
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    52
626
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
    53
 mailsys=> \i /path/to/vmm-0.6.1/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql
579
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    54
 mailsys=> \q
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    55
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    56
Dovecot v1.0.x/v1.1.x
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    57
"""""""""""""""""""""
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    58
.. code-block:: postgresql-console
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    59
626
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
    60
 mailsys=> \i /path/to/vmm-0.6.1/pgsql/update_tables_0.5.x-0.6.pgsql
579
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    61
 mailsys=> \q
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    62
599
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
    63
.. _set-database-permissions:
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
    64
579
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    65
Set database permissions
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    66
^^^^^^^^^^^^^^^^^^^^^^^^
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    67
.. include:: ../pgsql_set_permissionspermissions.rst
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    68
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    69
Start Dovecot and Postfix again
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    70
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    71
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    72
.. warning:: All the views (*dovecot_…* and *postfix_…*) have been
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    73
   replaced by database functions.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    74
   So you have to adjust all your ``postfix/pgsql-*.cf`` files and also your
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    75
   ``/etc/dovecot/dovecot-sql.conf`` or ``/etc/dovecot/dovecot-sql.conf.ext``.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    76
626
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
    77
   See the `vmm-0.6.1/postfix/pgsql-*.cf` files and
579
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    78
   :ref:`Dovecot configuration <dovecot-sql-conf-ext>`/`dovecot-sql.conf.ext`
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    79
   or :ref:`Dovecot configuration <dovecot-sql-conf>`/`dovecot-sql-conf`.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    80
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    81
After a successfully update start Dovecot and Postfix again.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    82
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    83
.. code-block:: console
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    84
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    85
 root@host:~# /etc/init.d/dovecot start
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    86
 Starting IMAP/POP3 mail server: dovecot.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    87
 root@host:~# /etc/init.d/postfix start
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    88
 Starting Postfix Mail Transport Agent: postfix.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    89
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    90
Upgrade vmm
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    91
^^^^^^^^^^^
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    92
Finally execute the :file:`upgrade.sh` script.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    93
This will install the new code and also update your :file:`vmm.cfg`.
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    94
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    95
.. code-block:: console
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    96
626
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
    97
 root@host:~# cd /path/to/vmm-0.6.1
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
    98
 root@host:/path/to/vmm-0.6.1# ./upgrade.sh
579
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
    99
 Please have a look at your configuration: /usr/local/etc/vmm.cfg
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   100
 This are your Modified/Renamed/New settings:
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   101
 R   account.delete_directory = false
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   102
 R   account.directory_mode = 448
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   103
 R   account.disk_usage = false
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   104
 R   domain.delete_directory = false
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   105
 R   domain.directory_mode = 504
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   106
 R   domain.force_deletion = false
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   107
 R   domain.imap = true
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   108
 R   domain.pop3 = true
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   109
 R   domain.sieve = true
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   110
 R   domain.smtp = true
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   111
 R   domain.transport = dovecot:
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   112
 R   mailbox.folders = Drafts:Sent:Templates:Trash
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   113
 R   mailbox.root = Maildir
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   114
 R   misc.base_directory = /srv/mail
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   115
 M   misc.dovecot_version = 2.1.7
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   116
 R   misc.dovecot_version = 2.1.7
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   117
 R   misc.password_scheme = PLAIN
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   118
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   119
 Removed section "config" with option "done" (obsolte)
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   120
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   121
 Removed option "gid_mail" from section "misc" (obsolte)
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   122
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   123
626
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   124
Upgrading from vmm-0.6.0
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   125
------------------------
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   126
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   127
Database fixes
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   128
^^^^^^^^^^^^^^
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   129
Due to an error in :ref:`usertransport`'s argument parsing, it is possible
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   130
that some users' transport-ID points to the erroneous transport *domain*.
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   131
To fix that error in your database, execute the following SQL statement:
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   132
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   133
.. code-block:: psql
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   134
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   135
 UPDATE users SET tid = NULL
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   136
  WHERE tid = (SELECT tid FROM transport WHERE transport = 'domain');
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   137
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   138
If you are using Dovecot < v.1.2.0, you have to replace the database
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   139
function *dovecotpassword()*.
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   140
The *service_set.ssid* was selected unconditionally.
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   141
This may cause an empty result, which will make logins impossible.
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   142
To replace the function execute the following SQL statement:
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   143
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   144
.. code-block:: psql
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   145
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   146
 CREATE OR REPLACE FUNCTION dovecotpassword(
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   147
     IN localpart varchar, IN the_domain varchar) RETURNS SETOF dovecotpassword
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   148
 AS $$
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   149
     DECLARE
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   150
         record dovecotpassword;
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   151
         userid varchar(320) := localpart || '@' || the_domain;
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   152
    BEGIN
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   153
        FOR record IN
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   154
            SELECT userid, passwd, smtp, pop3, imap, managesieve
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   155
              FROM users, service_set, domain_data
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   156
             WHERE users.gid = (SELECT gid
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   157
                                  FROM domain_name
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   158
                                 WHERE domainname = the_domain)
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   159
               AND local_part = localpart
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   160
               AND users.gid = domain_data.gid
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   161
               AND CASE WHEN
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   162
                  users.ssid IS NOT NULL
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   163
                  THEN
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   164
                    service_set.ssid = users.ssid
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   165
                  ELSE
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   166
                    service_set.ssid = domain_data.ssid
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   167
                  END
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   168
            LOOP
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   169
                RETURN NEXT record;
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   170
            END LOOP;
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   171
        RETURN;
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   172
    END;
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   173
$$ LANGUAGE plpgsql STABLE
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   174
RETURNS NULL ON NULL INPUT
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   175
EXTERNAL SECURITY INVOKER;
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   176
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   177
                        Upgrade vmm
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   178
^^^^^^^^^^^
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   179
Execute the :file:`upgrade.sh`, in order to install the updated code.
f151defe7078 doc/web: Updated documentation for vmm-0.6.1.
Pascal Volk <user@localhost.localdomain.org>
parents: 599
diff changeset
   180
599
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   181
Upgrade to Dovecot ≧ v1.2.beta2
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   182
-------------------------------
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   183
When you are upgrading your old Dovecot (< v.1.2.beta2) to a newer version,
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   184
≧ v1.2.beta2, you also have to update the database layout.
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   185
After you have backed up your database, you have to apply the changes from
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   186
the file :file:`dovecot_update_v1.2+.pgsql` to your database.
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   187
(The file is currently only available from hg:
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   188
`dovecot_update_v1.2+.pgsql <http://hg.localdomain.org/vmm/raw-file/bb23693e5fc9/pgsql/dovecot_update_v1.2%2B.pgsql>`_)
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   189
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   190
Connect as your `vmm` database user to your database.
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   191
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   192
.. code-block:: console
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   193
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   194
 user@host:~$ psql mailsys vmm -W -h localhost
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   195
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   196
Then do the database update:
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   197
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   198
.. code-block:: postgresql-console
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   199
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   200
 mailsys=> \i /path/to/dovecot_update_v1.2+.pgsql
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   201
 mailsys=> \q
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   202
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   203
Finally :ref:`set-database-permissions`.
82e722f35aab doc/web: Added description 'Upgrade to Dovecot ≧ v1.2.beta2'.
Pascal Volk <user@localhost.localdomain.org>
parents: 579
diff changeset
   204
579
be0906181a10 doc: Added source of http://vmm.localdomain.org/.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff changeset
   205
.. include:: ../ext_references.rst