File UPGRADING.SUSE of Package otrs

Upgrading OTRS from 3.3 to 4
============================

These instructions are for people upgrading OTRS from *3.3* to *4* or from a 4
to a later patchlevel release 4 and applies both for RPM and source code (tarball) upgrades.

If you are running a lower version of OTRS you have to follow the upgrade path to 3.3 first
(1.1->1.2->1.3->2.0->2.1->2.2->2.3->2.4->3.0->3.1->3.2->3.3)! You need to perform a full
upgrade to every version in between, including database changes and the upgrading perl script.

Please note that if you upgrade from OTRS 2.2 or earlier, you have to take an extra step.

Within a single minor version you can skip patch level releases if you want to upgrade.
For instance you can upgrade directly from OTRS 4 patchlevel 2 to version 4 patchlevel 6.
If you need to do such a "patch level upgrade", you should skip steps 6, 11, 13 and 14.

It is highly recommended to perform a test update on a separate testing machine first. 


1. Stop all relevant services
-----------------------------

e. g. (depends on used services):

    shell> rcotrs stop
    shell> rcotrs-scheduler stop
    shell> rcapache2 stop

2. Backup everything below @OTRS_ROOT@ (default: OTRS_ROOT=@OTRS_ROOT@)
---------------------------------------------------------------------

- Kernel/Config.pm
- Kernel/Config/GenericAgent.pm
- Kernel/Config/Files/ZZZAuto.pm
- var/*
- as well as the database


3. Make sure that you have backed up everything ;-)
---------------------------------------------------


4. Install the new release (RPM)
--------------------------------

    shell> rpm -Uvh otrs-4.0.*noarch.rpm

The RPM-update will keep the old configuration files.

- Kernel/Config.pm
- Kernel/Config/GenericAgent.pm
- Kernel/Config/Files/ZZZAuto.pm (will be overwritten by itsm)

You must use the new files *.rpmnew

- Kernel/Config.pm.rpmnew

    shell> cp -a Kernel/Config.pm Kernel/Config.pm.backup
    shell> mv Kernel/Config.pm.rpmnew Kernel/Config.pm

Then modify Kernel/Config.pm to adapt your settings (e.g. DB connection)


5. Check needed Perl modules
----------------------------

    shell> @OTRS_ROOT@/bin/otrs.CheckModules.pl


6. Apply the database changes
-----------------------------

     shell> cd @OTRS_ROOT@


### SCHEMA UPDATE

MySQL:

 Note: new tables created in the MySQL UPGRADING process will be created with the
 default table storage engine set in your MySQL server.
 In MySQL 5.5 the new default type is InnoDB.
 If existing tables, e.g. "users", have the table storage engine e.g. MyISAM,
 then an error will be displayed when creating the foreign key constraints.

 You have two options: you can change the default storage engine of MySQL back to MyISAM
 so that new tables will have the same engine as the existing tables,
 or change the existing tables to use InnoDB as storage engine.

 Any problems with regards to the storage engine will be reported by the
 `otrs.CheckDB.pl` script, so please run it to check for possible issues.

    shell> bin/otrs.CheckDB.pl
    shell> cat scripts/DBUpdate-to-4.mysql.sql | mysql -p -f -u root otrs

PostgreSQL 8.2+:

    shell> cat scripts/DBUpdate-to-4.postgresql.sql | psql --set ON_ERROR_STOP=on --single-transaction otrs otrs


### DATABASE MIGRATION SCRIPT

 Run the migration script (as user `otrs`, NOT as `root`):

    shell> scripts/DBUpdate-to-4.pl

 Do not continue the upgrading process if this script did not work properly for you.
 Otherwise data loss may occur.


7. Own themes
-------------

Note: The OTRS themes of 3.3 are NOT compatible with OTRS 4, so don't use your old themes!

Themes are located under `@OTRS_ROOT@/Kernel/Output/HTML/*/*.tt` (default: `OTRS_ROOT=@OTRS_ROOT@`)

Please note that OTRS 4 comes with a new templating engine based on Template::Toolkit.
All customized templates must be converted from DTL to the new format. Please see the
development manual for detailed instructions.


8. Refresh the configuration cache and delete caches
-----------------------------------------------------

Please run (as user `otrs`, NOT as `root`):

    shell> bin/otrs.RebuildConfig.pl
    shell> bin/otrs.DeleteCache.pl


9. Restart your services
-------------------------

e. g. (depends on used services):

    shell> rcapache start
    shell> rcotrs start
    shell> rcotrs-scheduler start

Now you can log into your system.


10. Check installed packages
----------------------------

Note: The OTRS packages of 3.3 are NOT compatible with OTRS 4, so you have to perform a package upgrade! 

The following packages are automatically uninstalled after the upgrade process (if they where
installed before):

- OTRSGenericInterfaceREST
- OTRSMyServices
- OTRSStatsRestrictionByDateTimeDF
- Support

11. Check GenericAgent jobs
---------------------------

If you have any GenericAgent jobs (or even any custom developments) that automatically
set ProcessID or ActivityID dynamic fields, you need to update these to set the fields
to the new long EntityIDs that were generated by DBUpdate-to-4.pl.


12. Update and activate cronjobs
--------------------------------

There are several OTRS default cronjobs in $OTRS_HOME/var/cron/*.dist.
They can be activated by copying them without the ".dist" filename extension.
Do this to make sure you get the latest versions of the cronjobs and new cronjobs
as well.

    shell> cd var/cron
    shell> for foo in *.dist; do cp $foo `basename $foo .dist`; done

Please check the copied files and re-apply any customizations that you might have made.

Note: From OTRS 3.3.7 OTRS Scheduler uses a cronjob to start-up and keep alive. Please make sure
that scheduler_watchdog cronjob is activated.


13: Update Customer database configuration
------------------------------------------

If you're using an external customer database and this database does NOT provide the OTRS
specific fields create_time, create_by, change_time and change_by, please set ForeignDB => 1
for $Self->{CustomerUser} and $Self->{CustomerCompany} (see Kernel/Config/Defaults.pm).


14: Rebuild Ticket index
------------------------

Please run

    shell> bin/otrs.RebuildTicketIndex.pl

to regenerate the ticket index. This can be done in the background to calculate the ticket
numbers for the queue view screens. You can already use your system.


15: Well done!
--------------
openSUSE Build Service is sponsored by