Updating OTRS

Note

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

The database migration from OTRS 5 to 6 performs significant changes to database tables and data. Please make sure that there is enough storage space available for these operations (it might be worth considering to temporarily turn off archive/binary logs for the migration).

Updating from an earlier version of OTRS 6

You can update directly from any previous to the latest available patch level release.

Updating from OTRS 5

You can update from any OTRS 5 patch level to the latest available OTRS 6 patch level release.

Updating from OTRS 4 or earlier

Warning

You cannot update from OTRS 4 or earlier directly to OTRS 6. Full updates to all available minor versions have to be made sequentially instead. For example, if you come from OTRS 3.0, you first have to perform a full update to OTRS 3.1, then to 3.2, 3.3, 4, 5 and finally to OTRS 6.

Step 1: Stop all relevant services and the OTRS Daemon

Please make sure there are no more running services or cron jobs that try to access OTRS. This will depend on your service configuration, here is an example:

root> /etc/init.d/cron stop
root> /etc/init.d/postfix stop
root> /etc/init.d/apache stop
            

Stop OTRS cron jobs and the daemon (in this order):

otrs> cd /opt/otrs/
otrs> bin/Cron.sh stop
otrs> bin/otrs.Daemon.pl stop
            

Step 2: Backup files and database

  • Kernel/Config.pm

  • Kernel/Config/Files/ZZZAuto.pm, if updating from OTRS 5

  • var/*

  • as well as the database

Warning

Don't proceed without a complete backup of your system.

Step 3: Install the new release (tar or RPM)

Step 3.1: With the tarball:

root> cd /opt
root> mv otrs otrs-old
root> tar -xzf otrs-x.x.x.tar.gz
root> mv otrs-x.x.x otrs
            
Restore old configuration files

  • Kernel/Config.pm

  • Kernel/Config/Files/ZZZAuto.pm, if updating from OTRS 5

Restore article data

If you configured OTRS to store article data in the file system you have to restore the article folder to /opt/otrs/var/ or the folder specified in the System Configuration.

Restore already installed default statistics

If you have additional packages with default statistics you have to restore the stats xml files with the suffix *.installed to /opt/otrs/var/stats.

root> cd OTRS-BACKUP/var/stats
root> cp *.installed /opt/otrs/var/stats
                
Set file permissions

Please execute the following command as root user to set the file and directory permissions for OTRS. It will try to detect the correct user and group settings needed for your setup.

root> cd /opt/otrs/
root> bin/otrs.SetPermissions.pl
                

Step 3.2: With the RPM:

root> rpm -Uvh otrs-x.x.x.-01.rpm
            

In this case the RPM update automatically restores the old configuration files and sets file permissions.

Step 4: Run the migration script

Note

If you have any custom Perl or XML configuration files in Kernel/Config/Files, these need to be converted to the new formats supported by OTRS 6 before running the migration script.

The migration script will perform many checks on your system and give you advice on how to install missing Perl modules etc., if that is required. If all checks succeeded, the necessary migration steps will be performed. Please also run this script in case of patch level updates.

Note

The migration script will ask you to set a time zone for OTRS if needed. It is very important that you set the correct time zone (OTRSTimeZone) for data storage and keep it, otherwise date and time of data added after the update (tickets, articles, etc.) will be stored with a different time zone than your pre-existing data, leading to inconsistent output.

For new systems, using UTC is recommended, as users can have different personal time zones for working with the OTRS application. For existing, migrated systems, a different OTRSTimeZone should be used if the underlying operating system is not configured to UTC or if OTRS previously used a time offset.

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

otrs> cd /opt/otrs/
otrs> scripts/DBUpdate-to-6.pl
        

Warning

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

Step 5: Update installed packages

Note

Packages for OTRS 5 are not compatible with OTRS 6 and have to be updated.

You can use the command below to update all installed packages. This works for all packages that are available from online repositories. You can update other packages later via the package manager (this requires a running OTRS Daemon).

otrs> cd /opt/otrs/
otrs> bin/otrs.Console.pl Admin::Package::UpgradeAll
        

Step 6: Restart your services

This will depend on your service configuration, here is an example:

root> /etc/init.d/apache start
root> /etc/init.d/postfix start
root> /etc/init.d/cron start
        

Note

The OTRS Daemon is required for correct operation of OTRS such as sending emails. Please activate it as described in the next step.

Step 7: Start the OTRS Daemon and cron job

The OTRS Daemon is responsible for handling any asynchronous and recurring tasks in OTRS. The daemon and its keepalive cron job must be started as the otrs user.

otrs> cd /opt/otrs/
otrs> bin/otrs.Daemon.pl start
otrs> bin/Cron.sh start
            

Now you can log into your system.