Changes between Version 19 and Version 20 of howto/ZarafaMigrateConnectux


Ignore:
Timestamp:
12/16/10 19:31:59 (13 years ago)
Author:
Edwin Eefting
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/ZarafaMigrateConnectux

    v19 v20  
    4242'''Mocht de conversie onderbroken worden met de melding 'ERROR 1153 (08S01) at line 24818: Got a packet bigger than 'max_allowed_packet' bytes', dan dient u deze instelling hoger te maken in beide mysql config files'''
    4343
    44 == User ID's converteren ==
     44== User ID's en database conversie ==
    4545
    46 ...volgt nog
     46Kopieer de passwd file van de oude server naar /root en gebruik dit script
     47{{{
     48#!/bin/bash
    4749
    48 == Attachments converteren ==
    49 
    50  * De attachements van de database naar files converteren:
    51 {{{
    52 [Syn-3] root@server ~# perl /usr/doc/zarafa/db-convert-attachments-to-files root `cat /etc/my.passwd` zarafa /home/system/zarafa delete && chown -R zarafa:zarafa /home/system/zarafa
    53 
    54 The size of all attachments in the database is: 19859619840 Bytes (18.5 GB)
    55 Available space is: 260109750272 Bytes (242.25 GB)
    56 Finding all attachments...
    57 Processing 51327 attachments
    58 Done.
    59 Remember to correct the ownership of the files for Zarafa to access, when Zarafa is not running as root
    60 [Syn-3] root@server ~#
    61 }}}
     50svcdownchk /service/zarafa-server
    6251
    6352
    64 == Zarafa eerste keer starten ==
     53SQLPW=`cat /etc/my.passwd`
    6554
    66  * De eerste keer als u zarafa start zullen er enige interne conversies plaats vinden. Ook dit kan lang duren. Ook de attachments zijn geconverteerd, hiervoor is het nodig de server eenmalig handmatig te starten:
    67 {{{
    68 [Syn-3] root@server ~# svc -d /service/zarafa-server
    69 [Syn-3] root@server ~# zarafa-server --ignore-attachment-storage-conflict
    70 [Syn-3] root@server ~# tail -f /var/log/zarafa/server.log                                                                                                         
    71 Thu Dec  9 13:34:09 2010: Failed to create store (id=1), errorcode=0x80000008
    72 Thu Dec  9 15:25:32 2010: Shutting down.
    73 Thu Dec  9 15:25:32 2010: Still waiting for 8 threads to exit
    74 Thu Dec  9 15:25:33 2010: Server shutdown complete.
    75 Tue Dec 14 16:32:16 2010: Starting zarafa-server version 6,40,3,23410, pid 24037
    76 Tue Dec 14 16:32:16 2010: Connection to database 'zarafa' succeeded
    77 Tue Dec 14 16:32:16 2010: Using commercial license serial ''
    78 Tue Dec 14 16:32:16 2010: Start: Adding externid to 'object' table
    79 Tue Dec 14 16:32:16 2010: Done: Adding externid to 'object' table
    80 Tue Dec 14 16:32:16 2010: Start: Creating Single Instance Attachment table
    81 Tue Dec 14 17:12:53 2010: Done: Creating Single Instance Attachment table
    82 Tue Dec 14 17:12:53 2010: Start: Locking multiserver capability
    83 Tue Dec 14 17:12:53 2010: Done: Locking multiserver capability
    84 Tue Dec 14 17:12:53 2010: Start: Creating Addressbook Changes table
    85 Tue Dec 14 17:12:54 2010: Done: Creating Addressbook Changes table
    86 Tue Dec 14 17:12:54 2010: Start: Updating 'singleinstances' table to correct tag value
    87 Tue Dec 14 17:12:54 2010: Done: Updating 'singleinstances' table to correct tag value
    88 Tue Dec 14 17:12:54 2010: Start: Create table: synced messages
    89 Tue Dec 14 17:12:54 2010: Done: Create table: synced messages
    90 Tue Dec 14 17:12:54 2010: Start: Force Addressbook Resync
    91 Tue Dec 14 17:12:54 2010: Skipped: Force Addressbook Resync
    92 Tue Dec 14 17:12:54 2010: Start: Rename objecttype columns to objectclass
    93 Tue Dec 14 17:12:54 2010: Done: Rename objecttype columns to objectclass
    94 Tue Dec 14 17:12:54 2010: Start: Convert objecttype columns to objectclass values
    95 Tue Dec 14 17:12:54 2010: Done: Convert objecttype columns to objectclass values
    96 Tue Dec 14 17:12:54 2010: Start: Add object MV property table
    97 Tue Dec 14 17:12:54 2010: Done: Add object MV property table
    98 Tue Dec 14 17:12:54 2010: Start: Link objects in DB plugin through companyid
    99 Tue Dec 14 17:12:54 2010: Done: Link objects in DB plugin through companyid
    100 Tue Dec 14 17:12:54 2010: Start: Update outgoingqueue key
    101 Tue Dec 14 17:12:54 2010: Done: Update outgoingqueue key
    102 Tue Dec 14 17:12:54 2010: Start: Update acl key
    103 Tue Dec 14 17:12:54 2010: Done: Update acl key
    104 Tue Dec 14 17:12:54 2010: Start: Update externid in object table
    105 Tue Dec 14 17:12:54 2010: Done: Update externid in object table
    106 Tue Dec 14 17:12:54 2010: Start: Update keys in 'changes' table
    107 Tue Dec 14 17:13:27 2010: Done: Update keys in 'changes' table
    108 Tue Dec 14 17:13:27 2010: Start: Update mvproperties key
    109 Tue Dec 14 17:13:28 2010: Done: Update mvproperties key
    110 Tue Dec 14 17:13:28 2010: Start: Update DB plugin group to security groups
    111 Tue Dec 14 17:13:28 2010: Done: Update DB plugin group to security groups
    112 Tue Dec 14 17:13:28 2010: Start: Update DB/Unix plugin sendas settings
    113 Tue Dec 14 17:13:28 2010: Done: Update DB/Unix plugin sendas settings
    114 ...
    115 Tue Dec 14 19:13:56 2010: Ignoring attachment storing conflict as requested. Attachments are now stored with option 'files'
    116 Tue Dec 14 19:15:40 2010: /etc/zarafa/userscripts/createuser: User store 'administratie' created.
    117 ..
     55if ! [ "$SKIPUSER" ]; then
     56
     57echo "SYN-3: Reading user ID converions:"
     58echo "old user id -> username -> new user id"
     59for OLDUID in `echo 'select externid from users where object_type=1 and externid>0' |mysql -p$SQLPW zarafa`; do
     60    [ "$OLDUID" == "externid" ] && continue;
     61   
     62    USER=`cat ~/passwd |egrep ".+:.+:$OLDUID:"|cut -f1 -d:`
     63    NEWUID=`getent passwd |egrep "$USER:.+:.+:"|cut -f3 -d:`
     64    echo "$OLDUID -> $USER -> $NEWUID"
     65    if [ "$USER" == "" ];  then
     66        echo "Old user $OLDUID not found in old passwd file!"
     67        exit 1
     68    fi
     69    if [ "$NEWUID" == "" ];  then
     70        echo "User $USER does not exist on this system yet!"
     71        exit 1
     72    fi
     73    QUERY="$QUERY""update users set externid='$NEWUID' where (externid='$OLDUID');\n"
     74done
     75
     76if [ "$QUERY" == "" ];then
     77    echo "Something went wrong.."
     78    exit 1
     79fi
     80
     81echo "SYN-3: Updating database:"
     82echo -e "$QUERY" | mysql -p$SQLPW zarafa || exit 1
     83fi
     84
     85echo "SYN-3: Starting zarafa in conversion mode:"
     86tail -f /var/log/zarafa/server.log &
     87zarafa-server --ignore-attachment-storage-conflict
     88                                   
     89while [ `netstat -nap | grep "LISTEN.*zarafa-server" | wc -l` -lt 2 ]; do
     90    echo "SYN-3: Waiting for conversion to finish..."
     91    sleep 60
     92done
     93
     94killall zarafa-server tail
     95
     96echo "SYN-3: Converting attachments from database to files"
     97perl /usr/doc/zarafa/db-convert-attachments-to-files root $SQLPW zarafa /home/system/zarafa delete || exit 1
     98chown -R zarafa:zarafa /home/system/zarafa || exit 1
     99
     100
     101svcstart /service/zarafa-server || exit 1
     102echo "SYN-3: Conversion done, Zarafa should be available now."
    118103
    119104}}}
    120