The release upgrade file describes how a system is upgraded in runtime.
This file is used by systools
to generate start scripts
and release upgrade files.
The tedious work of writing the relup
file has been
automated and in most cases this file can be automatically
generated from the .rel
file and .appup
files for
the applications in the release.
A release upgrade file is called relup
. In the target
system, this file must be located in the
OTP_ROOT/erts-EVsn/Vsn
directory.
The relup
file contains one single Erlang term, which
contains instructions on how to upgrade from old versions to
this version, and how to downgrade from this version to older
versions. The file has the following syntax:
{Vsn, [{FromVsn, Descr, RuScript}], [{ToVsn, Descr, RuScript}]}.
Vsn = string()
is the version of the release.
FromVsn = string()
is a version of a release
that we can upgrade from. If the current version of the
system matches this version, the corresponding upgrade
instructions in RuScript
is used to install the
release in the system.
ToVsn = string()
is a version of a release that
we can downgrade to. If this release (Vsn
) is the
current release, and we are about to downgrade to
ToVsn
, the corresponding upgrade instructions in
RuScript
is used to install the old release in the
system.
Descr
is a user defined parameter which is not
processed by any release handling functions. It can be used
to describe the release to an operator. Eventually, it will
be returned by release_handler:install_release/1
and
release_handler:check_install_release/1
.
RuScript
is a release upgrade script. Refer to
the section Release Handling Instructions in the SASL User's
Guide for a description of this script.
There is one tuple {FromVsn, Descr, RuScript}
for each
old system version which can be upgraded to this version, and
one tuple {ToVsn, Descr, RuScript}
for each old version
that this version can be downgraded to.
When upgrading from
FromVsn
with release_handler:install_release/1
,
there does not have to be an exact match of
versions. FromVsn
can be a sub-string of the current
version of the system. For example, if the current version is
"2.1.1"
, we can upgrade from FromVsn
"2.1"
or "2.1.1"
, but not from "2.0"
or
"2.1.1.2"
. However, if this scheme is used, the same
release upgrade script is used to go from both "2.1"
and
"2.1.1"
. Therefore, "2.1.1"
must be compatible
with "2.1"
. If you do not want to use this feature, you
must make sure that the current version and the new version
match before you call install_release/1
.
app(4), appup(4), rel(4), systools(3)