[id='applying-server-patches_{context}']
= Applying patches to {brandname} Server installations

Upgrade or downgrade {brandname} Server installation to a {brandname} version by installing patches.

.Prerequisites

ifdef::community[]
* Create a server patch for the target version.
endif::community[]
ifdef::downstream[]
* Download a server patch for the target version.
endif::downstream[]

.Procedure

. Navigate to `{server_home}` for the {brandname} Server installation you want to patch.
. Stop the {brandname} Server if it is running.
+
[NOTE]
====
If you patch a server while it is running, the version changes take effect
after restart. If you do not want to stop the server, create a new cluster with
the target version and perform a rolling upgrade to that version instead of
patching.
====
+
. Start the CLI.
+
[source,options="nowrap",subs=attributes+]
----
bin/cli.sh
----

. Install the patch.
+
[source,options="nowrap",subs=attributes+]
----
[disconnected]> patch install path/to/patch.zip

{fullbrandname} patch target=$target_version source=$source_version \
created=$timestamp installed=$timestamp
----
+
* `$target_version` displays the {brandname} version that the patch installed.
* `$source_version` displays the {brandname} version before you installed the patch.

. Start the server to verify the patch is installed.
+
[source,options="nowrap",subs=attributes+]
----
bin/server.sh
...
ISPN080001: {fullbrandname} Server $version
----
+
If the patch is installed successfully `$version` matches `$target_version`.

[TIP]
====
Use the `--server` option to install patches in a different `{server_home}`
directory, for example:

[source,options="nowrap",subs=attributes+]
----
patch install path/to/patch.zip --server=path/to/server/home
----
====
