# Upgrading High Availability Installation

{% hint style="info" %}
Before upgrading the PBX HA, please consult with PortSIP support to ensure the versions are compatible.
{% endhint %}

Please follow the below steps to upgrade your current PBX HA.

## Back up data

Before upgrading, please back up the PBX data.

1. Stop the PBX service

Perform the below command only on the **pbx01.**

```sh
cd /opt/portsip-pbx-ha-guide && sudo /bin/bash ha_ctl.sh stop -s pbx
```

2. Check the current master node

Perform the below command only on the **pbx01.**

```sh
cd /opt/portsip-pbx-ha-guide && sudo /bin/bash ha_ctl.sh master
```

For example, the below output indicates the current master node is **pbx01**.&#x20;

<figure><img src="/files/rg3UYZsoFgAGAtlaZN2G" alt=""><figcaption></figcaption></figure>

3. Back up data

Log in to the current master node, and back up the PBX data directory: `/var/lib/portsip`

## Download and update resources

Perform the below command only on the **pbx01.**

```sh
  cd /opt && rm -rf portsip-pbx-ha-guide-16-online.tar.gz && \
  sudo wget -N https://www.portsip.com/downloads/ha/v16/portsip-pbx-ha-guide-16-online.tar.gz \
  && sudo tar xf portsip-pbx-ha-guide-16-online.tar.gz
```

## **Update**

Use the new version image of PortSIP PBX to update the PBX.

{% hint style="danger" %}
Please contact PortSIP support to obtain the **\<PortSIP PBX new version image>** before upgrading.
{% endhint %}

Perform the below command only on the **pbx01.**

<pre class="language-sh"><code class="lang-sh"><strong>cd /opt/portsip-pbx-ha-guide/ &#x26;&#x26; /bin/bash update.sh &#x3C;PortSIP PBX new version image>
</strong></code></pre>

For example:

```sh
cd /opt/portsip-pbx-ha-guide/ && /bin/bash update.sh portsip/pbx:16.4.4.2814-release
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.portsip.com/v16.x-maintenance-mode/high-availability-v16.x/high-availability-for-on-premise/upgrading-high-availability-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
