# Manually upgrading moregroupware

This appendix contains the instructions for manually upgrading moregroupware, as they have been posted to the mailing lists.

If you need to upgrade from e.g. 0.6.4 to 0.6.6, you need to perform the upgrade in two steps, from 0.6.4 to 0.6.5 and finally to 0.6.6. This is true for all versions!

You should only attempt an upgrade if you still feel comfortable after(!) reading the instructions. You need some knowledge of what you are doing. It worked for the author, but no warranty is given whatsoever!

## Upgrading from 0.6.2 to 0.6.3

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

1. Backup your 0.6.2 directory, just to make sure!

   `cp -R moregroupware moregroupware.bak`

2. Backup your database, just to make sure!

   `mysqldump --add-drop-table -a -u [user] -p [dbname] > mgw062.sql`

3. Get the new release.

   `wget http://prdownloads.sourceforge.net/moregroupware/moregroupware_0_6_3.tar.gz`

4. Unpack the files from the archive, overwriting the old stuff.

   `cd /one/folder/above/moregroupware`

   `tar xzf moregroupware_0_6_3.tar.gz`

5. 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] < mgw062-mgw063.sql`

   Here is the SQL mentioned above:

                 ALTER TABLE mgw_todo ADD COLUMN priority char(1) default '3';
                 INSERT INTO mgw_configtags VALUES (55,'show_company_id','1','1 if company id is to be shown, 0 if not','0','0','int','','');
                 INSERT INTO mgw_configtags VALUES (56,'todo_orderby','3','default order of todos','0','0','str','','');
                 INSERT INTO mgw_configtags VALUES (57,'todo_order_dir','3','order asc or desc','0','0','str','','');
                 INSERT INTO mgw_configtags VALUES (58,'todo_merged','3','showin todos merged','0','0','int','','')

6. Now log in and verify everything works as expected (or at least as good as before...).

7. If all is up and running, you can safely delete the files backup 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 [dbname] < mgw062.sql`

## Upgrading from 0.6.3 to 0.6.4(pl1)

What follows are instructions to update a moregroupware release 0.6.3 to the new 0.6.4pl1. The same procedure works for updating to 0.6.4, but this release is not at all recommended for use!

If you have 0.6.4 already running, an update to 0.6.4pl1 just consists of unpacking the files over the old ones. Database changes were minimal and dealt mostly with improving default rights.

You will loose your settings and rights adjustments, sorry! There were some substantial changes to the database structure this time.

After the upgrade you will get errors like `Unknown column 'c.configtagid'`. These are not caused by the update, but are bugs in some parts of the code. You should upgrade to a newer version.

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

1. Backup your 0.6.3 directory!!!

   `cp -R moregroupware moregroupware.bak`

2. Backup your database!!!

   `mysqldump --add-drop-table -a -u [user] -p [dbname] > mgw063.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_4pl1.tar.gz`

5. Clean the database now, using the SQL shown below.

   `mysql -u [user] -p [dbname] < clean.sql`

   Here is the SQL mentioned above:

                 DROP TABLE IF EXISTS mgw_calendar;
                 DROP TABLE IF EXISTS mgw_calendar_tmp;
                 DROP TABLE IF EXISTS mgw_companies;
                 DROP TABLE IF EXISTS mgw_config;
                 DROP TABLE IF EXISTS mgw_configtags;
                 DROP TABLE IF EXISTS mgw_contacts;
                 DROP TABLE IF EXISTS mgw_contacts_groups;
                 DROP TABLE IF EXISTS mgw_contacts_history;
                 DROP TABLE IF EXISTS mgw_countries;
                 DROP TABLE IF EXISTS mgw_forum_forums;
                 DROP TABLE IF EXISTS mgw_forum_groups;
                 DROP TABLE IF EXISTS mgw_forum_moderators;
                 DROP TABLE IF EXISTS mgw_forum_threads;
                 DROP TABLE IF EXISTS mgw_forum_users;
                 DROP TABLE IF EXISTS mgw_groups;
                 DROP TABLE IF EXISTS mgw_groups_members;
                 DROP TABLE IF EXISTS mgw_headline;
                 DROP TABLE IF EXISTS mgw_headline_channels;
                 DROP TABLE IF EXISTS mgw_jobhours_occupation;
                 DROP TABLE IF EXISTS mgw_jobhours_prices;
                 DROP TABLE IF EXISTS mgw_jobhours_time;
                 DROP TABLE IF EXISTS mgw_languages;
                 DROP TABLE IF EXISTS mgw_modules;
                 DROP TABLE IF EXISTS mgw_news;
                 DROP TABLE IF EXISTS mgw_news_channels;
                 DROP TABLE IF EXISTS mgw_partprog;
                 DROP TABLE IF EXISTS mgw_projects;
                 DROP TABLE IF EXISTS mgw_rights;
                 DROP TABLE IF EXISTS mgw_todo;
                 DROP TABLE IF EXISTS mgw_translations;
                 DROP TABLE IF EXISTS mgw_users;

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

7. 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] < mgw063.sql`

8. 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] < mgw063-mgw064.sql`

   Here is the SQL mentioned above:

                 ## mysqldiff 0.29
                 ##
                 ## run on Tue May 28 18:52:52 2002
                 ##
                 ## ---   db: mgw063
                 ## +++   db: mgw064

                 ALTER TABLE mgw_companies ADD COLUMN state varchar(50) default NULL;

                 DELETE FROM mgw_config;
                 ALTER TABLE mgw_config DROP COLUMN configtagid; # was int(11) NOT NULL default '0'
                 ALTER TABLE mgw_config ADD COLUMN configtagname varchar(100) NOT NULL default '0' AFTER userid;
                 ALTER TABLE mgw_config DROP PRIMARY KEY; # was (userid,configtagid,serialnr)
                 ALTER TABLE mgw_config ADD PRIMARY KEY (userid,configtagname,serialnr);

                 DELETE FROM mgw_configtags;
                 ALTER TABLE mgw_configtags DROP COLUMN moduleid; # was int(11) NOT NULL default '0'
                 ALTER TABLE mgw_configtags DROP COLUMN id; # was int(11) NOT NULL default '0'
                 ALTER TABLE mgw_configtags ADD COLUMN modulename varchar(100) NOT NULL default '0' AFTER configtagname;
                 ALTER TABLE mgw_configtags DROP PRIMARY KEY; # was (id,configtagname)
                 ALTER TABLE mgw_configtags ADD PRIMARY KEY (configtagname);

                 INSERT INTO mgw_config VALUES (0,'iconmode',1,'',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'css_skin_theme',1,'Morelogs_Silver.css',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'language',1,'en',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'iconid',1,'',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'set_timefmt',1,'24h',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'set_hourminsep',1,':',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'set_datefmt',1,'ddmmyy',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'set_dmysep',1,'/',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'datefmt',1,'d/m/y',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'timefmt',1,'H:i',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'currency',1,'eur',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'calendar_viewfrom',1,'',8,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'calendar_viewto',1,'',17,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'calendar_remindermail',1,'',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'calendar_interval',1,'',30,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'holiday_system',1,'en',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'calendar_defaultview',1,'index.php',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'quicksearchmethod',1,'mgw_contacts.firstname',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'quicksearchmethod',2,'mgw_contacts.lastname',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'quicksearchmethod',3,'mgw_companies.name1',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'contacts_per_page',1,'',10,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'birthdayremindoffset',1,'-1',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'birthdayremindmethod',1,'EMAIL',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'birthdayremind_on_off',1,'',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'favourite_countries',1,'DEU',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'favourite_countries',2,'FRA',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'favourite_countries',3,'CZE',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'favourite_countries',4,'GBR',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'todos_per_page',1,'',10,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_pop3user',1,'pop3user',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_pop3pw',1,'pop3password',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_apop',1,'',1,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_pop3host',1,'pop3hostname',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_smtphost',1,'smtphostname',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_sort',1,'Arrival Time',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_viewheader',1,'',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_maxattach',1,'',3,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_replyto',1,'replyto@adress.com',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_emailsperpage',1,'',10,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_fromname',1,'From Name',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'wm_signature',1,'',0,'Some default Signature','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forum_posts_per_page',1,'',5,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forum_replies_per_page',1,'',5,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forum_pages',1,'',5,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forum_threads_viewtime',1,'',30,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forum_animatedgifs',1,'',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forum_signature',1,'',0,'This is the default
                 +Signature','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forum_mylogo',1,'',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_withmoderator',1,'',1,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_withsignature',1,'',1,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_withlogos',1,'',1,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_editownthreads',1,'',1,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_withemailnotify',1,'',1,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_mailsubject',1,'Default email subject',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_mailfromname',1,'Moregroupware_System',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_mailfromadress',1,'default@someadress.com',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_footeremailnotice',1,'some other email adress could be here',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'forumgen_footerhpnotice',1,'some homepage informations could be here',0,'','',1,00000000000000);
                 INSERT INTO mgw_config VALUES (0,'headline_proxy',1,'',0,'','',1,00000000000000);

                 INSERT INTO mgw_configtags VALUES ('iconmode','*','true if links should be icons, false if links should be text',1,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('css_skin_theme','*','which CSS file to use / actual theme file',1,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('language','*','which language to use (language id)',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('iconid','*','Icon Style (for different icon types)',0,0,'int',1,20011111000000);
                 INSERT INTO mgw_configtags VALUES ('set_timefmt','*','12h or 24h time format',0,0,'str',1,20011227235843);
                 INSERT INTO mgw_configtags VALUES ('set_hourminsep','*','seperator in time displays between hour and minute',0,0,'str',1,20011227235832);
                 INSERT INTO mgw_configtags VALUES ('set_datefmt','*','dateformat (settings notation)',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('set_dmysep','*','day-month-year seperator',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('datefmt','*','dateformat PHP date notation',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('timefmt','*','timeformat based on PHP date()',0,0,'str',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('currency','*','user currency',0,0,'str',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('calendar_viewfrom','calendar','daytime from where to display the appointments',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('calendar_viewto','calendar','daytime until appointments should appear',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('calendar_remindermail','calendar','send email reminds in calendar',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('calendar_interval','calendar','time intervalls for calendar in minutes',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('holiday_system','calendar','for which country to evaluate holidays',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('calendar_defaultview','calendar','default calendar view',0,0,'str',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('quicksearchmethod','contact','WHat fields to look for when quick searching',1,1,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('contacts_per_page','contact','How many contacts to display on one page',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('birthdayremindoffset','contact','Days before or after birthday to remind (-1 = one day before, +1 one day after, 0 = same day ...)',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('birthdayremindmethod','contact','How the reminder should remind',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('birthdayremind_on_off','contact','remind on / off',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('favourite_countries','contact','list of top 5 favourite countries',0,1,'str',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('show_company_id','contact','1 if company id is to be shown, 0 if not',0,0,'int',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('todos_per_page','todo','how many contacts to display before paging occurs',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('todo_orderby','todo','default order of todos',0,0,'str',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('todo_order_dir','todo','order asc or desc',0,0,'str',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('todo_merged','todo','showin todos merged',0,0,'int',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('todo_emaildelegade','todo','mailing delegaded todos',0,0,'int',0,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_pop3user','wmail','POP3 User/Account',0,1,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_pop3pw','wmail','POP3 Password',0,1,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_apop','wmail','Authentication via APOP',0,1,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_pop3host','wmail','hostname of POP3 Server',0,1,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_smtphost','wmail','hostname of SMTP Server',0,1,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_sort','wmail','Sorting of maillist',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_viewheader','wmail','View Emailheader',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_maxattach','wmail','max attachments',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_replyto','wmail','Reply-To Adress',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_emailsperpage','wmail','how many email per page',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_fromname','wmail','Email From Name',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('wm_signature','wmail','Signature',0,1,'txt',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forum_posts_per_page','forum','nr of posts per page in forum',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forum_replies_per_page','forum','how many replies per page in forum',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forum_pages','forum','nr of forum pages',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forum_threads_viewtime','forum','how many days a thread should be visible',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forum_animatedgifs','forum','use animated gifs in forum',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forum_signature','forum','your signature',0,0,'txt',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forum_mylogo','forum','your personal logo',0,0,'blob',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_withmoderator','forum','with moderators',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_withsignature','forum','with signatures',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_withlogos','forum','with Logos',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_editownthreads','forum','if users can edit their own threads',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_withemailnotify','forum','with email remind on new posts',0,0,'int',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_mailsubject','forum','subject of email',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_mailfromname','forum','name of mail sender',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_mailfromadress','forum','emailadress of sender',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_footeremailnotice','forum','footer information regarding email',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('forumgen_footerhpnotice','forum','footer information regarding homepage',0,0,'str',1,00000000000000);
                 INSERT INTO mgw_configtags VALUES ('headline_proxy','headline','proxy setting for headline',0,0,'str',0,00000000000000);

                 ALTER TABLE mgw_contacts ADD COLUMN priv_state varchar(50) default NULL;

                 ALTER TABLE mgw_modules DROP PRIMARY KEY; # was (id)
                 ALTER TABLE mgw_modules DROP COLUMN id; # was int(5) NOT NULL default '0'
                 ALTER TABLE mgw_modules DROP INDEX modulename; # was UNIQUE (modulename)
                 ALTER TABLE mgw_modules ADD PRIMARY KEY (modulename);

                 DELETE FROM mgw_rights;

                 ALTER TABLE mgw_rights DROP PRIMARY KEY; # was (moduleid,user_group_id)
                 ALTER TABLE mgw_rights DROP COLUMN moduleid; # was int(5) NOT NULL default '0'
                 ALTER TABLE mgw_rights ADD COLUMN modulename varchar(50) NOT NULL default '0' FIRST;
                 ALTER TABLE mgw_rights ADD PRIMARY KEY (modulename,user_group_id);

                 INSERT INTO mgw_rights VALUES ('forum',50002,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('forum',50003,1,1,1,1,1,1,6,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('admin',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('calendar',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('calendar',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('contact',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('contact',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('overview',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('overview',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('projects',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('projects',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('settings',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('settings',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('todo',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('todo',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('wmail',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('wmail',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('forum',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('forum',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('headline',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('headline',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('news',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('news',50001,1,1,1,0,1,0,3,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('partprog',50000,1,1,1,1,1,1,9,1,00000000000000);
                 INSERT INTO mgw_rights VALUES ('partprog',50001,1,1,1,0,1,0,3,1,00000000000000);

                 ALTER TABLE mgw_todo CHANGE COLUMN fromuserid fromuserid int(11) default NULL; # was int(5) default NULL
                 ALTER TABLE mgw_todo CHANGE COLUMN userid userid int(11) NOT NULL default '0'; # was int(7) NOT NULL default '0'
                 ALTER TABLE mgw_todo CHANGE COLUMN projectid projectid tinyint(11) NOT NULL default '0'; # was tinyint(4) NOT NULL default '0'
                 ALTER TABLE mgw_todo ADD COLUMN endtype char(1) default '1';

9. Now log in and verify everything works as expected (or at least as good as before...).

10. 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 [dbname] < mgw063.sql`

## 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`

## Upgrading from 0.6.5 to 0.6.6

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

1. Backup your 0.6.5 directory!!!

   `cd /one/folder/above/moregroupware`

   `cp -R moregroupware moregroupware.bak`

2. Backup your database!!!

   `mysqldump --add-drop-table -a -u [user] -p [dbname] > ~/mgw065.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 and cache (and store) folders.

   `cd /one/folder/above/moregroupware`

   `rm -r moregroupware/*`

   `tar xzf moregroupware_0_6_6.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] < ~/mgw065.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] < mgw065-mgw066.sql`

   Here is the SQL mentioned above:

                 ALTER TABLE mgw_calendar CHANGE COLUMN subject subject TEXT NOT NULL; # was varchar(100) NOT NULL default ''
                 ALTER TABLE mgw_calendar_tmp CHANGE COLUMN subject subject TEXT NOT NULL; # was varchar(100) NOT NULL default ''

                 INSERT INTO mgw_configtags VALUES ('overview_news','news','numer of news to show in overview',0,0,'int',1,'2002-01-01');
                 INSERT INTO mgw_configtags VALUES ('def_module','*','default module to show',0,0,'str',1,'2002-01-01');
                 INSERT INTO mgw_configtags VALUES ('overview_notes','notes','numer of notes to show in overview',0,0,'int',1,'2002-01-01');
                 INSERT INTO mgw_configtags VALUES ('notes_orderby','notes','default order of notes',0,0,'str',1,'2002-01-01');
                 INSERT INTO mgw_configtags VALUES ('notes_order_dir','notes','order asc or desc',0,0,'str',1,'2002-01-01');

                 ALTER TABLE mgw_config DROP COLUMN value_blob; # was blob NOT NULL
                 INSERT INTO mgw_config VALUES (0,'def_module',1,'overview',0,'',1,'2002-01-01');
                 INSERT INTO mgw_config VALUES (0,'overview_news',1,'5',0,'',1,'2002-01-01');
                 INSERT INTO mgw_config VALUES (0,'overview_notes',1,'5',0,'',1,'2002-01-01');
                 UPDATE mgw_config SET value_int=1 WHERE value_str='checked';

                 ALTER TABLE mgw_contacts_history CHANGE COLUMN contact_date contact_date timestamp(14) NOT NULL; # was datetime NOT NULL default '0000-00-00 00:00:00'

                 ALTER TABLE mgw_headline_channels ADD COLUMN private INTEGER NOT NULL default '0';
                 ALTER TABLE mgw_headline_rss ADD COLUMN private INTEGER NOT NULL default '0';
                 ALTER TABLE mgw_headline_rss ADD COLUMN lu_date timestamp(14) NOT NULL;
                 ALTER TABLE mgw_headline_rss ADD COLUMN lu_user INTEGER NOT NULL default '0';

                 ALTER TABLE mgw_jobhours_time CHANGE COLUMN time time decimal(8,2) NOT NULL default '0.00'; # was decimal(4,2) NOT NULL default '0.00'

                 ALTER TABLE mgw_notes_categories DROP INDEX name_key; # was UNIQUE (name)
                 ALTER TABLE mgw_notes_categories ADD INDEX name (name);

                 ALTER TABLE mgw_projects CHANGE COLUMN startdate startdate date default NULL; # was date NOT NULL default '0000-00-00'
                 ALTER TABLE mgw_projects CHANGE COLUMN enddate enddate date default NULL; # was date NOT NULL default '0000-00-00'

                 ALTER TABLE mgw_users ADD COLUMN lastin timestamp(14) NOT NULL;

                 CREATE TABLE mgw_files (
                 id INTEGER NOT NULL default '0',
                 type CHAR(1) NOT NULL default 'f',
                 resides_in INTEGER default NULL,
                 owner INTEGER NOT NULL default '0',
                 name varchar(50) default NULL,
                 mime_type varchar(20) default NULL,
                 owner_rights CHAR(1) NOT NULL default '',
                 all_rights CHAR(1) NOT NULL default '',
                 created timestamp(14) NOT NULL,
                 modified timestamp(14) NOT NULL,
                 modified_by INTEGER default NULL,
                 links_to INTEGER default NULL,
                 PRIMARY KEY  (id),
                 UNIQUE KEY resides_in (resides_in,name)
                 );

                 CREATE TABLE mgw_files_grouprights (
                 id INTEGER NOT NULL default '0',
                 for_file INTEGER default NULL,
                 for_group INTEGER default NULL,
                 rights CHAR(1) NOT NULL default '',
                 PRIMARY KEY  (id),
                 UNIQUE KEY for_file (for_file,for_group)
                 );

                 CREATE TABLE mgw_outboard (
                 id_username INTEGER NOT NULL default '0',
                 tsout INTEGER NOT NULL default '0',
                 tsin INTEGER NOT NULL default '0',
                 location TEXT,
                 notes TEXT,
                 autoin CHAR(1) NOT NULL default '',
                 statusid CHAR(2) NOT NULL default '',
                 lu_user INTEGER NOT NULL default '0',
                 lu_update INTEGER NOT NULL default '0',
                 PRIMARY KEY  (id_username)
                 );

   If you have been using the webmail2 module, make sure you restore the contents of the `modules/webmail2/store/` directory. Now read the webmail2 update manual in `MGW_0-65_to_0-66_Webmail_Update_manual.pdf` in `modules/webmail2/docu/`! You need to drop the webmail2 tables and restore them from your SQL backup before this will work!

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] < mgw065.sql`

## Upgrading from 0.6.6 to 0.6.7

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

1. Backup your 0.6.6 directory!!!

   `cd /one/folder/above/moregroupware`

   `cp -R moregroupware moregroupware.bak`

2. Backup your database!!!

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

3. Get the new release from sourceforge.net.

4. Unpack the files from the archive.

   `cd /one/folder/above/moregroupware`

   `tar xzf moregroupware_0_6_7.tar.gz`

5. There are a few changes that need to be done to the `config.inc.php` file.

   `The following lines need to be added and/or changed. The first two may seem less important, but at least the version is needed for correct bug reports.`

       $appconf["mgw_version"] = "0.6.7 - Spring";
       $appconf["mgw_releasedate"] = "200304xx";
       $appconf["def_language"] = "en";

       $appconf["use_ntlm_auth"]= "";
       $appconf["encrypt_pwd"]= "0";

       define("SETUP_RUNNING", false);
       define("LANG_DEBUG", false);

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

   There will be errors, so redirect the output somewhere you can easily read it! You will need to fix some things manually (e.g. duplicate keys, remove the old entry in such cases, and similar things)!

   `mysql -u [user] -p [dbname] < mgw066-mgw067.sql`

   Here is the SQL mentioned above:

       ALTER TABLE mgw_contacts DROP COLUMN keyType; # was varchar(150) default NULL
       ALTER TABLE mgw_contacts ADD COLUMN keytype varchar(150) default NULL;

       ALTER TABLE mgw_files CHANGE COLUMN name name varchar(255) default NULL; # was varchar(50) default NULL
       ALTER TABLE mgw_files CHANGE COLUMN mime_type mime_type varchar(70) default NULL; # was varchar(20) default NULL
       ALTER TABLE mgw_files ADD COLUMN size int(11) NOT NULL default '0';

       ALTER TABLE mgw_todo ADD COLUMN startdate timestamp(14) NOT NULL;
       ALTER TABLE mgw_todo ADD COLUMN starttype char(1) default '1';

       CREATE TABLE mgw_instmsg (
         id int(11) NOT NULL default '0',
         sender int(11) NOT NULL default '0',
         recipient int(11) NOT NULL default '0',
         subject varchar(255) NOT NULL default '',
         message text NOT NULL,
         status char(1) NOT NULL default 'N',
         PRIMARY KEY  (id),
         KEY mimrecidx (recipient),
         KEY statidx (status)
       );

       CREATE TABLE mgw_log (
         id int(11) NOT NULL default '0',
         sort int(11) NOT NULL default '0',
         session varchar(128) NOT NULL default '',
         stamp int(11) NOT NULL default '0',
         level int(11) NOT NULL default '1',
         module varchar(30) NOT NULL default 'general',
         line int(11) NOT NULL default '0',
         file varchar(255) NOT NULL default '',
         message text NOT NULL
       );

       CREATE TABLE mgw_notes_comments (
         id int(11) NOT NULL default '0',
         note_id int(11) NOT NULL default '0',
         comment text NOT NULL,
         lu_update timestamp(14) NOT NULL,
         lu_user int(11) NOT NULL default '0',
         PRIMARY KEY  (id)
       );

       CREATE TABLE mgw_notifications (
         id int(11) NOT NULL default '0',
         sender int(11) NOT NULL default '0',
         recipient int(11) NOT NULL default '0',
         message text NOT NULL,
         PRIMARY KEY  (id),
         KEY notrecidx (recipient)
       );

       INSERT INTO mgw_config VALUES (0,'enable_logging',1,'',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_admin',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_admin',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_admin',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_overview',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_overview',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_overview',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_settings',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_settings',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_settings',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_calendar',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_calendar',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_calendar',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_contact',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_contact',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_contact',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_files',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_files',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_files',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_forum',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_forum',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_forum',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_headline',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_headline',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_headline',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_news',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_news',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_news',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_notes',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_notes',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_notes',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_outboard',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_outboard',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_outboard',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_partprog',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_partprog',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_partprog',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_projects',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_projects',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_projects',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_todo',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_todo',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_todo',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_tts',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_tts',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_tts',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_webmail2',1,'',16,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_webmail2',2,'',8,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'log_webmail2',3,'',4,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'notify_js',1,'',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'notify_html',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'notify_mim_iframe',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'notify_mim_refresh',1,'',60,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'notify_mim_alert',1,'',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'notify_mail_from',1,'noreply@mgw.invalid',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'overview_get_modules',1,'news',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'overview_get_modules',2,'todo',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'overview_get_modules',3,'calendar',0,'',1,20020101000000);

       INSERT INTO mgw_config VALUES (0,'calendar_notification',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'calendar_notification',2,'',6,'',1,20020101000000);

       INSERT INTO mgw_config VALUES (0,'files_forbidden_mime',1,'application/x-msdos-program',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_deb_binary',1,'/usr/bin/dpkg',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_enscript_binary',1,'/usr/bin/enscript',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_mp3_binary',1,'/usr/bin/mp3info',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_msexcel_binary',1,'/usr/bin/xlhtml',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_mspowerpoint_binary',1,'/usr/bin/ppthtml',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_msword_binary',1,'/usr/bin/wvHtml',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_rar_binary',1,'/usr/bin/rar',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_rpm_binary',1,'/usr/bin/rpm',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_tgz_binary',1,'/bin/tar',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'mime_zip_binary',1,'/usr/bin/zipinfo',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (3,'def_module',1,'forum',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (4,'def_module',1,'forum',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forum_posts_per_page',1,'',5,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forum_replies_per_page',1,'',5,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forum_pages',1,'',5,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forum_threads_viewtime',1,'',30,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forum_animatedgifs',1,'',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forum_signature',1,'',0,'This is the default Signature',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forum_mylogo',1,'',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_withmoderator',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_withsignature',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_withlogos',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_editownthreads',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_withemailnotify',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_mailsubject',1,'Default email subject',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_mailfromname',1,'Moregroupware_System',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_mailfromadress',1,'default@someadress.com',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_footeremailnotice',1,'some other email adress could be here',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'forumgen_footerhpnotice',1,'some homepage informations could be here',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'headline_proxy',1,'',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'headline_version',1,'062',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'overview_news',1,'',5,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'overview_notes',1,'',5,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'notes_enable_comments',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'todos_per_page',1,'',10,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'todo_merged',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'todo_overview_unstarted',1,'',0,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'todo_notification',1,'',1,'',1,20020101000000);
       INSERT INTO mgw_config VALUES (0,'todo_notification',2,'',6,'',1,20020101000000);

       INSERT INTO mgw_configtags VALUES ('enable_logging','*','global enable logging',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_admin','*','admin module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_overview','*','overview module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_settings','*','settings module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_calendar','*','calendar module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_contact','*','contact module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_files','*','files module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_forum','*','forum module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_headline','*','headline module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_news','*','news module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_notes','*','notes module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_outboard','*','outboard module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_partprog','*','partprog module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_projects','*','projects module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_todo','*','todo module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_tts','*','tts module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('log_webmail2','*','webmail2 module logging level',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notify_js','*','enable js notification',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notify_html','*','enable html notification',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notify_mim_iframe','*','enable iframe for MIM',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notify_mim_refresh','*','MIM refresh interval',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notify_mim_alert','*','enable alert for MIM',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notify_mail_from','*','mail notification sender mail',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('overview_get_modules','overview','What modules show in overview',1,1,'str',1,20020101000000);

       INSERT INTO mgw_configtags VALUES ('calendar_notification','calendar','notification for calendar',1,1,'int',1,20020101000000);

       INSERT INTO mgw_configtags VALUES ('use_dialer','contact','1 if dialer is to be shown, 0 if not',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('files_forbidden_mime','*','forbidden MIME types',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_deb_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_enscript_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_mp3_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_msexcel_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_mspowerpoint_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_msword_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_rar_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_rpm_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_tgz_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_zip_enable','*','enable mime viewer',1,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_deb_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_enscript_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_mp3_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_msexcel_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_mspowerpoint_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_msword_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_rar_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_rpm_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_tgz_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('mime_zip_binary','*','mime viewer binary',1,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forum_posts_per_page','forum','nr of posts per page in forum',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forum_replies_per_page','forum','how many replies per page in forum',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forum_pages','forum','nr of forum pages',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forum_threads_viewtime','forum','how many days a thread should be visible',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forum_animatedgifs','forum','use animated gifs in forum',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forum_signature','forum','your signature',0,0,'txt',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forum_mylogo','forum','your personal logo',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_withmoderator','forum','with moderators',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_withsignature','forum','with signatures',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_withlogos','forum','with Logos',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_editownthreads','forum','if users can edit their own threads',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_withemailnotify','forum','with email remind on new posts',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_mailsubject','forum','subject of email',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_mailfromname','forum','name of mail sender',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_mailfromadress','forum','emailadress of sender',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_footeremailnotice','forum','footer information regarding email',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('forumgen_footerhpnotice','forum','footer information regarding homepage',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('headline_proxy','headline','proxy setting for headline',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('headline_version','headline','',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('overview_news','news','numer of news to show in overview',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('overview_notes','notes','numer of notes to show in overview',0,0,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notes_orderby','notes','default order of notes',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notes_order_dir','notes','order asc or desc',0,0,'str',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('notes_enable_comments','notes','allow comments on notes',0,0,'int',1,20020101000000);

       INSERT INTO mgw_configtags VALUES ('todo_notification','todo','notification for delegaded todos',1,1,'int',1,20020101000000);
       INSERT INTO mgw_configtags VALUES ('todo_overview_unstarted','todo','show unstarted todos in overview',0,0,'int',1,20020101000000);

   If you have been using the webmail2 module, read the webmail2 update manual in `MGW_0-66_to_0-67_Webmail_Update_manual.pdf` in `modules/webmail2/docu/`!

7. Now log in and verify everything works as expected (or at least as good as before...) after going to the admin module and running the sequence check in the system tools area. This is an important step and could solve a lot of problems before they appear!

8. 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] < mgw066.sql`

## Upgrading from 0.6.7 to 0.6.8

This release does not fix the security issues that have been published! It is an interim release made available for testing thw new calendar and some bugfixes. Read the chapter on securing your setup, whether you upgrade or not!

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

1. Backup your 0.6.7 directory!!!

   `cd /one/folder/above/moregroupware`

   `cp -R moregroupware moregroupware.bak`

2. Backup your database!!!

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

3. Get the new release from sourceforge.net.

4. Unpack the files from the archive.

   `cd /one/folder/above/moregroupware`

   `tar xzf moregroupware_0_6_8.tar.gz`

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

   There will be errors, so redirect the output somewhere you can easily read it! You will need to fix some things manually (e.g. duplicate keys, remove the old entry in such cases, and similar things)!

   `mysql -u [user] -p [dbname] < mgw067-mgw068.sql`

   Here is the SQL mentioned above:

       ALTER TABLE mgw_files ADD COLUMN partno int(11) default NULL;
       ALTER TABLE mgw_files ADD COLUMN msg_id int(11) default NULL;

       ALTER TABLE mgw_projects ADD COLUMN targetdate date default NULL;
       ALTER TABLE mgw_projects ADD COLUMN completed char(1) default '0';

       ALTER TABLE mgw_webmail_links ADD COLUMN account int(11) NOT NULL default '0';
       ALTER TABLE mgw_webmail_sidebar ADD COLUMN account int(11) NOT NULL default '0';
       ALTER TABLE mgw_webmail_sidebar ADD COLUMN mboxname varchar(255) NOT NULL default '';

       CREATE TABLE mgw_calendar2_ics (
         dstart varchar(255) NOT NULL default '',
         dend varchar(255) NOT NULL default '',
         dnow varchar(255) NOT NULL default '',
         dsummary varchar(255) NOT NULL default '',
         dlocation varchar(255) NOT NULL default '',
         ddesc text,
         dclass varchar(255) NOT NULL default '',
         drep_freq varchar(255) NOT NULL default '',
         drep_until varchar(255) NOT NULL default '',
         drep_count int(11) NOT NULL default '0',
         drep_interval int(11) NOT NULL default '0',
         drep_days varchar(255) NOT NULL default '',
         drep_exdate text,
         dcategories text,
         dcalendar varchar(255) NOT NULL default '',
         c_duser_id int(11) NOT NULL default '0',
         duser_id int(11) NOT NULL default '0',
         id int(11) NOT NULL default '0',
         PRIMARY KEY  (id)
       ) TYPE=MyISAM;

       CREATE TABLE mgw_projects_comments (
         comment_id int(11) NOT NULL default '0',
         task_id int(11) NOT NULL default '0',
         owner int(11) default NULL,
         date timestamp(14) NOT NULL,
         comment text,
         PRIMARY KEY  (comment_id)
       ) TYPE=MyISAM;

       CREATE TABLE mgw_projects_tasks (
         task_id int(11) NOT NULL default '0',
         project_id int(11) NOT NULL default '1',
         parent_id int(11) NOT NULL default '0',
         title text,
         hours decimal(4,2) NOT NULL default '1.00',
         enddate date default NULL,
         description text,
         status char(1) default NULL,
         assignee int(11) NOT NULL default '1',
         billable char(1) NOT NULL default '0',
         comments char(1) NOT NULL default '0',
         PRIMARY KEY  (task_id)
       ) TYPE=MyISAM;

6. Now log in and verify everything works as expected (or at least as good as before...) after going to the admin module and running the sequence check in the system tools area. This is an important step and could solve a lot of problems before they appear!

7. 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] < mgw067.sql`

## Upgrading from 0.6.8 to 0.6.9

These instructions are also valid for upgrades from earlier 0.6.9 CVS versions to the released version.

There have been incompatible changes to the projects module. If you use this module, try out this new version in a seperate installment to see if it (still) fits your needs. Upon upgrading the list of projects should be carried over (and the timesheets data should survive, although invisible), but please be careful.

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

1. Backup your 0.6.8 directory!!!

   `cd /one/folder/above/moregroupware`

   `cp -R moregroupware moregroupware.bak`

2. Backup your database!!!

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

3. Get the new release from sourceforge.net.

4. Move the webmail2 store folder to it's new location (you can safely delete the cache folders).

   former structure: `mgw/modules/webmail2/store/0`

   new structure: `mgw/data_store/webmail2/0`

5. Move the files module store folder to it's new location.

   former structure: `mgw/modules/files/store/`

   new structure: `mgw/data_store/files/`

6. Make the data_store folder (and the subfolders!) writable for the webserver.

7. Delete everything in the more.groupware root folder except(!) `data_store`, `config.inc.php` and `templates_c`.

8. Unpack the new files from the archive(s).

   `cd /one/folder/above/moregroupware`

   `tar xzf moregroupware_0_6_9.tar.gz`

9. Now edit `config.inc.php`.

   - Remove the line `$appconf['rootpath'] = ...` (if present).

   - Add the forcessl parameter (if not already present):

         $appconf['forcessl'] = 0;

   - Add a trailing slash to rooturl (if missing):

         $appconf['rooturl'] = 'http://.../mgw/';

   - If present, remove the following lines:

         $appconf['html_compressor'] = false;
         $appconf['html_compressor_debug'] = false;

   - Add the following lines (if missing):

         $appconf['mgw_version_number'] = '0.6.9';
         $appconf['mgw_version_name'] = 'Security';

   - Change the following line:

         $appconf['mgw_version'] = '0.6.8 - Nick';

     to

         $appconf['mgw_version'] = '0.6.9 - Security / Update';

10. Open up your browser and log in to more.groupware as admin, the general module is updated automatically.

    Log in as admin again, the update for the overview module is done.

    Go to the module manager and install the Admin2 module.

11. Now go to every installed module as admin to call the update procedure.

12. Check for the correct renaming of webmail2 tables:

    - Access the database, e.g. with phpMyAdmin.

    - The table names must now be `mgw_webmail2_accounts`, `mgw_webmail2_messages` and so forth instead of `mgw_webmail_accounts`, `mgw_webmail_messages`. In other words, `webmail2` must be used instead of `webmail`.

13. Check whether the emails in webmail2 have the new store path in the database:

    - Access the database, e.g. with phpMyAdmin.

    - View the contents of the table `mgw_webmail2_messages`.

    - The `msg_body` field must always begin with `../../data_store/webmail2/` (except for `docu1.eml` where it has to be `docu/`).

14. Now go to the Admin2 module and set the permissions for your users/groups for the modules. Important: the 'Access Module' permission.

15. 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] < mgw068.sql`

## Upgrading from 0.6.8/0.6.9 to 0.7.0

Use the instructions for upgrading from 0.6.8 to 0.6.9 if you upgrade from 0.6.8.

If you upgrade from 0.6.9 there is nothing to do except unpack the new files and call each module as admin to run the upgrade scripts.

## Upgrading from 0.7.0 to 0.7.1

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

1. Backup your 0.7.0 directory!!!

   `cd /one/folder/above/moregroupware`

   `cp -R moregroupware moregroupware.bak`

2. Backup your database!!!

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

3. Get the new release from sourceforge.net.

4. Delete everything in the more.groupware root folder except(!) `data_store`, `data_cache`, `config.inc.php` and `templates_c`.

5. Unpack the new files from the archive(s).

   `cd /one/folder/above/moregroupware`

   `tar xzf moregroupware-0.7.1.tar.gz`

6. Now edit `config.inc.php`.

   - Add this line (if not already present):

         if ($appconf['rooturl'][strlen($appconf['rooturl'])-1]!='/') $appconf['rooturl'] .= '/';
         define('ROOTURL', $appconf['rooturl']);

   - Adjust the following lines to fit:

         $appconf['mgw_version_number'] = '0.7.1';
         $appconf['mgw_version'] = '0.7.1 - Interim / Update';

7. Open up your browser and log in to more.groupware as admin, the general module is updated automatically.

   Log in as admin again, the update for the overview module is done.

8. If you run into trouble when logging in (error message about a missing column in mgw_news), manually change the URL in your browser's address bar to point to the news module. This will update the news module and the error should disappear.

9. Now go to every installed module as admin to call the update procedure.

10. 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] < mgw070.sql`