## 3.1. General upgrade concept

When upgrading from a previous OLAT version several things have to be done:

1. Download the new OLAT release and unzip it. Move your old olat first to a save location to have a backup if something goes wrong. Configure the new OLAT code as descibed in the installation section of this documentation. This involves using the correct values in the build.properties files and running of ant config-all. The following listing shows the necessary steps

       #cd PATH_TO_YOUR_OLAT
       #rm olat3 (if olat3 is a symlink, otherwise: mv olat3 olat3.1.3)
       #unzip OLAT-3.1.4.zip
       #ln -s OLAT-3.x olat3
       #cd olat3
       #cp build.properties.default build.properties
       #vi build.properties
       #ant config-all
       #ant install

   It is no problem to move from a OLT 3.1.0 installation directly to a 3.2 installation on the programm code level. This does not apply to the database changes as noted below.

   Note that the steps above will not change any data that resides in your olatdata directory when your have your olatdata defined outside the olat3 directory. The olatdata directroy should never be located in the olat3, this is only the place for the programm code!

2. Changeing the database model, adding new tables, altering existing tables due to changes in the programm code. This step is not always necessary. See if there is a file in PATH_TO_YOUR_OLAT/olat3/database/alter_*_to_*.sql that matches the version you want to install.

   Befor you do anything: please backup your database! Run something like this

       #mysqldump -u olat -p olat >mydump.sql

   It is very important that you execute this sql file in the correct order! When you are running OLAT version 3.1.2 for example it is absolutley mandatory that you run first the 3.1.2_to_3.1.3, then the 3.1.3_to_3.1.4 and only after that the 3.1.4_to_3.2.0!

   Please note that the provided scripts are NOT inteded to be run automatically. Please run them manually and execute every statement after another so that you can verify that no error occures. And please do also read the comments in the files, sometimes a change can not be done by a single query.

   Sometimes no database changes are necessary. In this cases, no alter file is provided.

   The provided alter files are written for a MySQL database. If you use another database, make sure you reviewed the queries properly.

3. Modifying files on the filesystems due to changes in the programm code. This step is very rarely necessary. If it is needed it will be described in the specific upgrade section in this manual. Usually a little script will help you performing this task.

4. Now start tomcat. The first launch might take some time.