Upgrading from 0.6.4pl1 to 0.6.5

Here is what to do (Unix style, log in to server first):

  1. Backup your 0.6.4pl1 directory!!!

    cd /one/folder/above/moregroupware

    cp -R moregroupware moregroupware.bak

  2. Backup your database!!!

    mysqldump --add-drop-table -a -u [user] -p [dbname] > ~/mgw064pl1.sql

  3. Get the new release from sourceforge.net.

  4. Unpack the files from the archive, remove the old stuff before. You can safely ignore errors on the template_c folders.

    cd /one/folder/above/moregroupware

    rm -r moregroupware/*

    tar xzf moregroupware_0_6_5.tar.gz

  5. Drop and recreate the database (or delete all tables in it).

    mysql -u [user] -p -e "DROP DATABASE [dbname]"

    mysql -u [user] -p -e "CREATE DATABASE [dbname]"

  6. Go through the usual setup process now. We will restore your data later.

  7. Again drop and recreate the database (or delete all tables in it).

    mysql -u [user] -p -e "DROP DATABASE [dbname]"

    mysql -u [user] -p -e "CREATE DATABASE [dbname]"

  8. Now let's restore your old data in the database. Use the dump created in step 2 to restore the data.

    mysql -u [user] -p [dbname] < ~/mgw064pl1.sql

  9. You need to adjust the database now. The SQL that is shown below needs to be inserted into the database.

    mysql -u [user] -p [dbname] < mgw064pl1-mgw065.sql

    Here is the SQL mentioned above:

              ALTER TABLE mgw_contacts CHANGE COLUMN publicKey publicKey TEXT; # was CHARACTER VARYING(150) default NULL
              ALTER TABLE mgw_contacts_history CHANGE COLUMN contact_company contact_company INTEGER NOT NULL default '0'; # was CHARACTER VARYING(255) NOT NULL default ''
              ALTER TABLE mgw_forum_threads CHANGE COLUMN thread_smiley thread_smiley CHARACTER VARYING(50) NOT NULL default ''; # was CHARACTER VARYING(15) NOT NULL default ''
              ALTER TABLE mgw_headline ADD COLUMN type INTEGER NOT NULL default '0';
              ALTER TABLE mgw_projects ADD COLUMN owner INTEGER NOT NULL default '0';
              
              DROP TABLE mgw_translations;
            
  10. Now log in and verify everything works as expected (or at least as good as before...).

  11. If all is up and running, you can safely delete the backup files and the SQL dump created in steps 1 and 2.

If you run into trouble, you can revert back to the old release by removing the new moregroupware directory, moving back the backup dir and just piping the backup SQL into the database:

rm -ri moregroupware

mv -i moregroupware.bak moregroupware

mysql -u [user] -p -e "DROP DATABASE [dbname]"

mysql -u [user] -p -e "CREATE DATABASE [dbname]"

mysql -u [user] -p [dbname] < mgw064pl1.sql