Location: PHPKode > projects > Emblem > emblem/calendar/README_FILES/UPGRADING.html
<HTML><HEAD><TITLE>WebCalendar Upgrading Notes</TITLE></HEAD><BODY BGCOLOR="#FFFFFF">

<H2>WebCalendar Upgrading Notes</H2>

Below are the steps needed to upgrade from a previous version.
If you are more than one version behind, start from the bottom
and work towards the top of this page.

<P><HR><P><B>To upgrade to 0.9.43 from 0.9.42 or older:</B>
<P>
  User passwords are now stored using md5 and require the webcal_user
  table to be altered to accomodate larger password data.
  Use the following SQL for MySQL and PostgreSQL:
  <BLOCKQUOTE><PRE>
   ALTER TABLE webcal_user MODIFY cal_passwd VARCHAR(32) NULL;
   DROP TABLE webcal_import_data;
   CREATE TABLE webcal_import (
     cal_import_id INT NOT NULL,
     cal_name VARCHAR(50) NULL,
     cal_date INT NOT NULL,
     cal_type VARCHAR(10) NOT NULL,
     cal_login VARCHAR(25) NULL,
     PRIMARY KEY ( cal_import_id )
   );
   CREATE TABLE webcal_import_data (
     cal_import_id INT NOT NULL,
     cal_id INT NOT NULL,
     cal_login VARCHAR(25) NOT NULL,
     cal_import_type VARCHAR(15) NOT NULL,
     cal_external_id VARCHAR(200) NULL,
     PRIMARY KEY  ( cal_id, cal_login )
   );
  </PRE></BLOCKQUOTE>
  For Oracle, use VARCHAR2 instead of VARCHAR.
  On very old MySQL installations (not sure which version), if you get
  a parse error, you can try the following instead:
  <BLOCKQUOTE><PRE>
   ALTER TABLE webcal_user CHANGE cal_passwd cal_passwd VARCHAR(32) NULL;
  </PRE></BLOCKQUOTE>
  </p><p>
  Next, you will need to run the script found in the <tt>tools</tt>
  subdirectory.  This will convert all your passwords from plain text
  to md5.  You can either run this from the command line (if you have
  a standalone version of PHP compiled):
  <BLOCKQUOTE><PRE>
    cd tools
    php convert_passwords.php
  </PRE></BLOCKQUOTE>
  If you do not have a standalone version of PHP, you can just type in
  the URL to access the script in your browser: <br>
  <tt>http://yourcalendarurl/tools/convert_passwords.php</tt><br>

<P><HR><P><B>To upgrade to 0.9.42 from 0.9.41 or older:</B>
<P>
  Three new tables were added: webcal_report,
   webcal_report_template, and webcal_import_data.
   Use the following SQL
  for MySQL and PostgreSQL:
  <BLOCKQUOTE><PRE>
   CREATE TABLE webcal_report (
     cal_login VARCHAR(25) NOT NULL,
     cal_report_id INT NOT NULL,
     cal_is_global CHAR(1) DEFAULT 'N' NOT NULL,
     cal_report_type VARCHAR(20) NOT NULL,
     cal_include_header CHAR(1) DEFAULT 'Y' NOT NULL,
     cal_report_name VARCHAR(50) NOT NULL,
     cal_time_range INT NOT NULL,
     cal_user VARCHAR(25) NULL,
     cal_allow_nav CHAR(1) DEFAULT 'Y',
     cal_cat_id INT NULL,
     cal_include_empty CHAR(1) DEFAULT 'N',
     cal_show_in_trailer CHAR(1) DEFAULT 'N',
     cal_update_date INT NOT NULL,
     PRIMARY KEY ( cal_report_id )
   );
   CREATE TABLE webcal_report_template (
     cal_report_id INT NOT NULL,
     cal_template_type CHAR(1) NOT NULL,
     cal_template_text TEXT,
     PRIMARY KEY ( cal_report_id, cal_template_type )
   );
   CREATE TABLE webcal_import_data (
     cal_id int NOT NULL,
     cal_login VARCHAR(25) NOT NULL,
     cal_import_type VARCHAR(15) NOT NULL,
     cal_external_id VARCHAR(200) NULL,
     PRIMARY KEY  ( cal_id, cal_login )
   );
  </PRE></BLOCKQUOTE>
  For Oracle, use VARCHAR2 instead of VARCHAR.

<P><HR><P><B>To upgrade to 0.9.41 from 0.9.40 or older:</B>
<P>
  One new table was added: webcal_nonuser_cals.
   Use the following SQL
  for MySQL and PostgreSQL:
  <BLOCKQUOTE><PRE>
   CREATE TABLE webcal_nonuser_cals (
     cal_login VARCHAR(25) NOT NULL,
     cal_lastname VARCHAR(25),
     cal_firstname VARCHAR(25),
     cal_admin VARCHAR(25) NOT NULL,
     PRIMARY KEY ( cal_login )
   );
  </PRE></BLOCKQUOTE>
  For Oracle, use VARCHAR2 instead of VARCHAR and LONG instead of TEXT.

<P><HR><P><B>To upgrade to 0.9.40 from 0.9.39 or older:</B>
<P>
  Two new tables were created: webcal_asst and webcal_entry_ext_user.
  And the column cal_ext_for_id was added to the webcal_entry table.
  Use the following SQL
  for MySQL and PostgreSQL:
  <BLOCKQUOTE><PRE>
    CREATE TABLE webcal_asst (
      cal_boss VARCHAR(25) NOT NULL,
      cal_assistant VARCHAR(25) NOT NULL,
      PRIMARY KEY ( cal_boss, cal_assistant )
    );
    CREATE TABLE webcal_entry_ext_user (
      cal_id INT DEFAULT 0 NOT NULL,
      cal_fullname VARCHAR(50) NOT NULL,
      cal_email VARCHAR(75) NULL,
      PRIMARY KEY ( cal_id, cal_fullname )
    );
  ALTER TABLE webcal_entry ADD cal_ext_for_id INT NULL;
  </PRE></BLOCKQUOTE>
  For Oracle, use VARCHAR2 instead of VARCHAR.

<P><HR><P><B>To upgrade to 0.9.39 from 0.9.38 or older:</B>
<P>
  The names of the date settings in the database were modified.
  All old data settings need to be removed from the database.
  <BLOCKQUOTE><PRE>
    DELETE FROM webcal_config WHERE cal_setting LIKE 'DATE_FORMAT%';
    DELETE FROM webcal_user_pref WHERE cal_setting LIKE 'DATE_FORMAT%';
  </PRE></BLOCKQUOTE>

<P><HR><P><B>To upgrade to 0.9.38 from 0.9.37 or older:</B>
<P>
  The webcal_entry_user table was modified, and a new table
  webcal_categories was created.  Use the following SQL
  to modify your table for MySQL and PostgreSQL:
  <BLOCKQUOTE><PRE>
    ALTER TABLE webcal_entry_user ADD cal_category INT DEFAULT NULL;

    CREATE TABLE webcal_categories (
      cat_id INT NOT NULL,
      cat_owner VARCHAR(25),
      cat_name VARCHAR(80) NOT NULL,
      PRIMARY KEY ( cat_id )
    );
  </PRE></BLOCKQUOTE>

<P><HR><P><B>To upgrade to 0.9.37 from 0.9.36 or older:</B>
<P>
  The webcal_entry_log table was modified, and a new table
  webcal_entry_repeats_not was created.  Use the following SQL
  to modify your table for MySQL and PostgreSQL:
  <BLOCKQUOTE><PRE>
    ALTER TABLE webcal_entry_log ADD cal_user_cal VARCHAR(25);

    CREATE TABLE webcal_entry_repeats_not (
      cal_id INT NOT NULL,
      cal_date INT NOT NULL,
      PRIMARY KEY ( cal_id, cal_date )
    );
  </PRE></BLOCKQUOTE>


<P><HR><P><B>To upgrade to 0.9.35 from 0.9.34 or older:</B>
<P>
  Six new tables were added for group support, views, system
  settings and activity logs.
  Look at tables-mysql.sql, tables-oracle.sql, or tables-postgres.sql
  for these new tables: webcal_group, webcal_group_user,
  webcal_view, webcal_view_user, wecbal_config, webcal_entry_log
  After adding these tables, be sure to go to the System Settings page
  (admin.php) since you will be missing some config stuff in your
  database that you can add from the System Settings page.
  For MySQL and PostgreSQL, the SQL is:
  <BLOCKQUOTE><PRE>

    CREATE TABLE webcal_group (
      cal_group_id INT NOT NULL,
      cal_owner VARCHAR(25) NULL,
      cal_name VARCHAR(50) NOT NULL,
      cal_last_update INT NOT NULL,
      PRIMARY KEY ( cal_group_id )
    );

    CREATE TABLE webcal_group_user (
      cal_group_id INT NOT NULL,
      cal_login VARCHAR(25) NOT NULL,
      PRIMARY KEY ( cal_group_id, cal_login )
    );

    CREATE TABLE webcal_view (
      cal_view_id INT NOT NULL,
      cal_owner VARCHAR(25) NOT NULL,
      cal_name VARCHAR(50) NOT NULL,
      cal_view_type CHAR(1),
      PRIMARY KEY ( cal_view_id )
    );

    CREATE TABLE webcal_view_user (
      cal_view_id INT NOT NULL,
      cal_login VARCHAR(25) NOT NULL,
      PRIMARY KEY ( cal_view_id, cal_login )
    );

    CREATE TABLE webcal_config (
      cal_setting VARCHAR(50) NOT NULL,
      cal_value VARCHAR(50) NULL,
      PRIMARY KEY ( cal_setting )
    );

    CREATE TABLE webcal_entry_log (
      cal_log_id INT NOT NULL,
      cal_entry_id INT NOT NULL,
      cal_login VARCHAR(25) NOT NULL,
      cal_type CHAR(1) NOT NULL,
      cal_date INT NOT NULL,
      cal_time INT NULL,
      cal_text TEXT,
      PRIMARY KEY ( cal_log_id )
    );
    </PRE></BLOCKQUOTE>

    <P><HR><P><B>To upgrade to 0.9.27:</B><P>

  Two new tables were added for custom event fields and reminders.
  Look at tables-mysql.sql, tables-oracle.sql, or tables-postgres.sql.
  Execute the SQL for creating webcal_site_extras and webcal_reminder_log.
  For MySQL and PostgreSQL, the SQL is:
  <BLOCKQUOTE><PRE>

    CREATE TABLE webcal_site_extras (
      cal_id INT DEFAULT '0' NOT NULL,
      cal_name VARCHAR(25) NOT NULL,
      cal_type INT NOT NULL,
      cal_date INT DEFAULT '0',
      cal_remind INT DEFAULT '0',
      cal_data TEXT,
      PRIMARY KEY ( cal_id, cal_name, cal_type )
    );

    CREATE TABLE webcal_reminder_log (
      cal_id INT DEFAULT '0' NOT NULL,
      cal_name VARCHAR(25) NOT NULL,
      cal_event_date INT NOT NULL DEFAULT 0,
      cal_last_sent INT NOT NULL DEFAULT 0,
      PRIMARY KEY ( cal_id, cal_name, cal_event_date )
    );
  </PRE></BLOCKQUOTE>
  For Oracle, the SQL is:
  <BLOCKQUOTE><PRE>
    CREATE TABLE webcal_site_extras (
      cal_id INT DEFAULT '0' NOT NULL,
      cal_name VARCHAR(25) NOT NULL,
      cal_type INT NOT NULL,
      cal_date INT DEFAULT '0',
      cal_remind INT DEFAULT '0',
      cal_data LONG,
      PRIMARY KEY ( cal_id, cal_name, cal_type )
    );

    CREATE TABLE webcal_reminder_log (
      cal_id INT DEFAULT '0' NOT NULL,
      cal_name VARCHAR(25) NOT NULL,
      cal_event_date INT NOT NULL DEFAULT 0,
      cal_last_sent INT NOT NULL DEFAULT 0,
      PRIMARY KEY ( cal_id, cal_name, cal_event_date )
    );
    </PRE></BLOCKQUOTE>

    <P>
  You will also need to setup the tools/send_reminders.php script
  to be run periodically.  I would recommend once an hour.  For
  Linux/UNIX, this is simple.  Just use cron and add a line to
  your crontab file that looks like:
  <BLOCKQUOTE><PRE>
    1 * * * * cd /some/directory/webcalendar/tools; ./send_reminders.php
    </PRE></BLOCKQUOTE>

    <P>
  This will tell cron to run the script at one minute after the hour.
  Windows users will have to find another way to run the script.
  There are ports/look-a-likes of cron for Windows, so look around.


  <P><HR><P><B>To upgrade to 0.9.22:</B><P>

  A new table was added to support layering.  Look at
  tables-mysql.sql, tables-oracle.sql, or tables-postgres.sql.
  Execute the SQL for creating the webcal_entry_repeats.  For MySQL,
  the SQL is:
  <BLOCKQUOTE><PRE>

    CREATE TABLE webcal_user_layers (
      cal_layerid INT DEFAULT '0' NOT NULL,
      cal_login varchar(25) NOT NULL,
      cal_layeruser varchar(25) NOT NULL,
      cal_color varchar(25) NULL,
      cal_dups CHAR(1) DEFAULT 'N',
      PRIMARY KEY ( cal_login, cal_layeruser )
    );
    </PRE></BLOCKQUOTE>


    <P><HR><P><B>To upgrade to 0.9.14:</B><P>

  A new table was added to support repeating events.  Look at
  tables-mysql.sql, tables-oracle.sql, or tables-postgres.sql.
  Execute the SQL for creating the webcal_entry_repeats.  For MySQL,
  the SQL is:
  <BLOCKQUOTE><PRE>
    CREATE TABLE webcal_entry_repeats (
      cal_id INT DEFAULT '0' NOT NULL,
      cal_type VARCHAR(20),
      cal_end INT,
      cal_frequency INT DEFAULT '1',
      cal_days CHAR(7),
      PRIMARY KEY (cal_id)
   );
    </PRE></BLOCKQUOTE>

    <P><HR><P><B>To upgrade from 0.9.7-0.9.11 to 0.9.12:</B><P>

  To fix a bug in the handing of events at midnight, all the
  entries with NULL for cal_time are changed to -1.  Use the
  following SQL command:
  <BLOCKQUOTE><PRE>
    update webcal_entry set cal_time = -1 where cal_time is null;
    </PRE></BLOCKQUOTE>

    <P><HR><P><B>To upgrade from 0.9.[23456] to 0.9.7:</B><P>

  Entirely new tables are used.  Use the following commands to
  convery your existing MySQL tables to the new tables:
  <BLOCKQUOTE><PRE>
    cd tools
    ./upgrade_to_0.9.7.pl
    mysql intranet < commands.sql
    </PRE></BLOCKQUOTE>
  where "intranet" is the name of the MySQL database that contains
  your WebCalendar tables.

  <P><HR><P><B>To upgrade from 0.9.[23]:</B><P>
  Not a thing....

  <P><HR><P><B>To upgrade from 0.9.1:</B><P>
  You only need to create the table cal_user_pref in tables.sql

  <P><HR><P><B>To upgrade from 0.9:</B><P>
  You need to create the table cal_user_pref in tables.sql
  You need to create the table cal_entry_user in tables.sql that
    was mistakenly created as "cal_event_user" in the 0.9 release

</BODY></HTML>
Return current item: Emblem