Upgrading UVOS server
---------------------

In most cases UVOS can be upgraded quite easily without changing database schema.
This section provides information on upgrade in general and also contains notes 
on upgrades between specific versions.

Before any update it is strongly suggested to backup original configuration and
database contents.


Update using yum
~~~~~~~~~~~~~~~~

If UVOS server was installed using yum then it is best to update it also using this tool.

Up to now the database schema has not been changed since the initial RPM release of
UVOS so DB schema update is not required. 

Yum updates most of the files automatically after running: 
 
  $ yum update unicore-uvos-server
 
However special attention must be made in case of configuration files. The configuration
files which were updated locally after initial installation, and which were changed in the
updated RPM are not updated. Instead new files will be saved next to the existing ones with
the +.rpmnew+ suffix. RPM will always warn you about each such file during update. 
For each such file you should compare it with the old one, and manually merge changes. Consult
the up-to-date manual to understand changes in the configuration format, however in most cases
changes are quite straightforward.    


Version specific notes
~~~~~~~~~~~~~~~~~~~~~~

These instructions apply to updating UVOS versions installed from tar.gz bundle.

*Version 1.4.2* - Libraries in the +lib/+ folder must be updated. Additionally there
were many changes in the configuration files (especially, but not only, under conf/db). 
It is advised to start from the new configuration files and apply local settings to them.

*Version 1.4.1* - It is enough to update libraries in the +lib/+ folder.

*Version 1.4.0* - It is required to update libraries in +lib/+ folder (+lib/endorsed+
	directory must be added too) and additionally +bin/_setenv.sh+ script must be updated.
	Also +crlcheck.properties+ file must be added to +conf/+ directory. Of course it is suggested
	to set it up. 

*Version 1.3.3* - It is only needed to update libraries in +lib/+ folder.

*Version 1.3.2* - Upgrade from 1.3.1 is quite easy: there is no need to update database 
	(the format was not altered). You must update:
	* libraries, 
	* start and stop scripts,
	* configuration file (see documentation for details):
	  * possible values of property +uvos.server.authn.order+ are now: 'TLS' and 'HTTP'
	    in any order.
	  * new boolean property should be defined (default is false):
	    +uvos.server.authn.mapTLSCertToDNFirst+

*Version 1.3.1* - It is only needed to update libraries in +lib/+ folder.

*Version 1.3* - Upgrade from 1.2 is easy. There is no need to update database
	(the format was not altered). Configuration files are mostly unchanged:
	only the new options were added for UNICORE registration support and
	for enabling/disabling usage of X509 cert identities as DN-type identities.

*Version 1.2* - Use generic upgrade instructions (below)

*Version 1.1* - Use generic upgrade instructions (below)

*Version 1.0* - it was an initial release so there is no upgrade possibility.


Generic upgrade instructions for tar.gz installations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Database upgrade
^^^^^^^^^^^^^^^^

In order to do upgrade from older version of the server to the current one you will 
sometimes have to 
update your database. This manual assumes that you installed a new 
version of UVOS in a new directory (what is strongly recommended).
It is not possible to use a different DB engine when upgrading 
(e.g. if old UVOS used postgreSQL the new one have to use it too).

Required actions:
 
 1. Stop the old UVOS server.
 2. (!!) Backup your database used by the old UVOS. If you use embedded
 DB (HSQL) you can skip this step.
 3. Install and configure (at least DB settings in datamap.properties) the new 
 UVOS installation. However do not start it or invoke initdb.sh script.
 -> in case of postgreSQL specify the same settings as was used by the
 old UVOS installation.
 -> in case of HSQL db just copy (copy, not move!) the contents of its data/ folder to
 the data/ folder of the new installation.
 4. Eventually you have to upgrade your DB. There is a script which does the job.
 It can upgrade from any older version to the current one, however only in steps. 

.EXAMPLE
To perform an upgrade from version 1.0 to 1.2 you will have to first upgrade to 1.1 and 
then to 1.2. To do so invoke:

	# bin/updateDbVersion.sh 1.0 1.1
	# bin/updateDbVersion.sh 1.1 1.2
	
If the script completes without errors you are done! Otherwise you should contact 
support mailing list.


Re-configuration
^^^^^^^^^^^^^^^^

We strongly advise to start from the configuration files provided in a new 
UVOS distribution and to update them manually to the previous settings.
Simply copying the old configuration files and overwriting the new installation
files can cause severe problems as often there are many configuration changes. 
 



