2017-09-01 03:25:47 +00:00
[[_install_new_version]]
2021-06-18 01:03:51 +00:00
== Upgrading the {project_name} server
2017-09-01 03:25:47 +00:00
2022-04-06 00:18:32 +00:00
Follow these guidelines to be sure the server upgrade is successful:
* Test the upgrade in a non-production environment first to prevent any installation issues in production,
* Upgrade the {project_name} server before upgrading the adapters. Also ensure the upgraded server is functional in production before upgrading adapters.
2021-12-17 10:44:32 +00:00
[WARNING]
====
2022-04-06 00:18:32 +00:00
This upgrade procedure may require modification due to manual changes that are specific to your installation. For details on manual changes that might affect the upgrade, see xref:release_changes[Release-specific changes].
2021-12-17 10:44:32 +00:00
====
2022-04-06 00:18:32 +00:00
ifeval::[{project_product}==true]
Upgrade the server from a xref:upgrade-zip[ZIP file] or an xref:rpm-upgrade[RPM] based on the method you had used for installation.
[id="upgrade-zip"]
=== Upgrading the server from a ZIP file
endif::[]
2017-09-01 03:25:47 +00:00
2021-06-18 01:03:51 +00:00
.Prerequisites
* Handle any open transactions and delete the data/tx-object-store/ transaction directory.
2017-09-01 03:25:47 +00:00
2021-06-18 01:03:51 +00:00
.Procedure
2022-04-06 00:18:32 +00:00
. Download the new server archive.
2017-09-01 03:25:47 +00:00
. Move the downloaded archive to the desired location.
. Extract the archive. This step installs a clean instance of the latest {project_name} release.
2021-06-18 01:03:51 +00:00
. For standalone installations, copy the `{project_dirref}/standalone/` directory from the previous installation over the
2017-09-01 03:25:47 +00:00
directory in the new installation.
+
2021-06-18 01:03:51 +00:00
For domain installations, copy the `{project_dirref}/domain/` directory from the previous installation over the directory
2017-09-01 03:25:47 +00:00
in the new installation.
+
2021-06-18 01:03:51 +00:00
For domain installations, create the empty directory `{project_dirref}/domain/deployments`.
2017-09-01 03:25:47 +00:00
+
2018-09-04 11:44:37 +00:00
NOTE:
2017-09-01 03:25:47 +00:00
Files in the bin directory should not be overwritten by the files from previous versions. Changes should be made manually.
. Copy any custom modules that have been added to the modules directory.
2022-04-06 00:18:32 +00:00
. Continue with the section, xref:upgrade-script[Running the server upgrade script].
2021-06-18 01:03:51 +00:00
2018-09-04 11:44:37 +00:00
ifeval::[{project_product}==true]
2021-06-18 01:03:51 +00:00
[id="rpm-upgrade"]
2022-04-06 00:18:32 +00:00
=== Upgrading the server from an RPM
2021-06-18 01:03:51 +00:00
.Prerequisites
* Handle any open transactions and delete the /var/opt/rh/rh-sso7/lib/keycloak/standalone/data/tx-object-store/ transaction directory.
.Procedure
2022-07-28 19:10:57 +00:00
. Subscribe to the proper repository containing {project_name}.
2021-05-18 17:58:35 +00:00
+
For Red Hat Enterprise Linux 7:
+
2022-07-28 19:10:57 +00:00
subscription-manager repos --enable=rh-sso-7.6-for-rhel-7-x86_64-rpms
2021-05-18 17:58:35 +00:00
+
For Red Hat Enterprise Linux 8:
2021-11-10 10:54:04 +00:00
+
2022-07-28 19:10:57 +00:00
subscription-manager repos --enable=rh-sso-7.6-for-rhel-8-x86_64-rpms
2018-09-04 11:44:37 +00:00
+
2022-07-28 19:10:57 +00:00
. Disable the older product repository for {project_name}:
2018-09-04 11:44:37 +00:00
2022-07-28 19:10:57 +00:00
subscription-manager repos --disable=rh-sso-7.5-for-rhel-8-x86_64-rpms
2018-09-04 11:44:37 +00:00
2022-04-06 00:18:32 +00:00
. Check the list of repositories:
dnf repolist
Updating Subscription Management repositories.
repo id repo name
2022-07-28 19:10:57 +00:00
rh-sso-7.6-for-rhel-8-x86_64-rpms Single Sign-On 7.6 for RHEL 8 x86_64 (RPMs)
2022-04-06 00:18:32 +00:00
rhel-8-for-x86_64-appstream-rpms Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
rhel-8-for-x86_64-baseos-rpms Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
. Back up any modified configuration files and custom modules.
2022-07-28 19:10:57 +00:00
. Use `dnf upgrade` to upgrade to the new Red Hat Single Sign-On version.
2022-04-06 00:18:32 +00:00
+
2022-07-28 19:10:57 +00:00
The RPM upgrade process does not replace any modified configuration files. Instead, this process creates .rpmnew files for the default configuration of the new Red Hat Single Sign-On version.
2022-04-06 00:18:32 +00:00
2022-07-28 19:10:57 +00:00
. To activate any new features in the new release, such as new subsystems, manually merge each .rpmnew file into your existing configuration files.
2022-04-06 00:18:32 +00:00
2018-09-04 11:44:37 +00:00
. Copy any custom modules that have been added to the modules directory.
2022-04-06 00:18:32 +00:00
. Continue with the section, xref:upgrade-script[Running the server upgrade script].
2018-09-04 11:44:37 +00:00
+
[NOTE]
====
{project_name} RPM server distribution is using
`{project_dirref}=/opt/rh/rh-sso7/root/usr/share/keycloak`
Use it when calling migration scripts below.
====
2022-04-06 00:18:32 +00:00
2018-09-04 11:44:37 +00:00
endif::[]
2022-04-06 00:18:32 +00:00
[id="upgrade-script"]
== Running the server upgrade script
Based on your previous installation, run the appropriate upgrade script that applies to your situation:
* xref:standalone-mode[Standalone mode]
* xref:standalone-ha[Standalone high availability mode]
* xref:domain-mode[Domain mode]
* xref:domain-clustered[Domain-clustered mode]
2021-06-18 01:03:51 +00:00
[id="standalone-mode"]
=== Running the Standalone Mode upgrade script
.Procedure
2017-09-01 03:25:47 +00:00
. If you are using a different configuration file than the default one, edit the migration script to specify the new file name.
. Stop the server.
2018-09-04 11:44:37 +00:00
. Run the upgrade script:
2017-09-01 03:25:47 +00:00
bin/jboss-cli.sh --file=bin/migrate-standalone.cli
2021-06-18 01:03:51 +00:00
[id="standalone-ha"]
=== Running the Standalone-High Availability Mode upgrade script
2017-09-01 03:25:47 +00:00
For standalone-high availability (HA) mode, all instances must be upgraded at the same time.
2021-06-18 01:03:51 +00:00
.Procedure
2017-09-01 03:25:47 +00:00
. If you are using a different configuration file than the default one, edit the migration script to specify the new file name.
. Stop the server.
2018-09-04 11:44:37 +00:00
. Run the upgrade script:
2017-09-01 03:25:47 +00:00
bin/jboss-cli.sh --file=bin/migrate-standalone-ha.cli
2021-06-18 01:03:51 +00:00
[id="domain-mode"]
=== Running the Domain Mode upgrade script
2017-09-01 03:25:47 +00:00
For domain mode, all instances must be upgraded at the same time.
2021-06-18 01:03:51 +00:00
.Procedure
2017-09-01 03:25:47 +00:00
. If you have changed the profile name, you must edit the upgrade script to change a variable near the beginning of the script.
. Edit the domain script to include the location of the keycloak-server.json file.
. Stop the server.
2021-06-18 01:03:51 +00:00
. Run the upgrade script on the domain controller
2021-06-18 01:03:51 +00:00
2017-09-01 03:25:47 +00:00
bin/jboss-cli.sh --file=bin/migrate-domain.cli
2021-06-18 01:03:51 +00:00
[id="domain-clustered"]
=== Running the Domain-clustered Mode upgrade script
For domain-clustered mode, all instances must be upgraded at the same time.
.Procedure
. If you have changed the profile name, you must edit the upgrade script to change a variable near the beginning of the script.
. Edit the domain-clustered script to include the location of the keycloak-server.json file.
. Stop the server.
. Run the upgrade script on the domain controller only:
bin/jboss-cli.sh --file=bin/migrate-domain-clustered.cli