# How to upgrade PostgreSQL server from one major version to another in 1+n node architecture.(Hotstandby enabled)

**URL:** <https://forums.percona.com/t/how-to-upgrade-postgresql-server-from-one-major-version-to-another-in-1-n-node-architecture-hotstandby-enabled/27193>\
**Category:** PostgreSQL\
**Created:** [December 15, 2023, 11:51pm UTC](https://forums.percona.com/t/how-to-upgrade-postgresql-server-from-one-major-version-to-another-in-1-n-node-architecture-hotstandby-enabled/27193 "2023-12-15T23:51:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krish\_jobs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/krish_jobs/32/14209_2.png) [@Krish\_jobs](https://forums.percona.com/u/Krish_jobs)\
**Post date:** [December 15, 2023, 11:51pm UTC](https://forums.percona.com/t/how-to-upgrade-postgresql-server-from-one-major-version-to-another-in-1-n-node-architecture-hotstandby-enabled/27193/1 "2023-12-15T23:51:22Z")

</div>

Hi, I am a PostgreSQL enthusiast learner and I have a question about upgrade steps.

For Example: 1) one major version to another and you do have replication between whether the nodes at same datacenter or different data centers?

1. Let’s say you have a database that you push that is currently configured with replication. So it’s part of the cluster, yeah. And you’re going to upgrade the major version from X to Y. Let’s say you’re going from 13 to 15, whatever that might be. What considerations do we need to take to minimize the impact to the cluster?

I want to know what the best practices are to follow when upgrading PostgreSQL. , Reference links or steps that will be helpful. Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Robert\_Bernier](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/robert_bernier/32/1367_2.png) [@Robert\_Bernier](https://forums.percona.com/u/Robert_Bernier)\
**Post date:** [December 16, 2023, 3:24pm UTC](https://forums.percona.com/t/how-to-upgrade-postgresql-server-from-one-major-version-to-another-in-1-n-node-architecture-hotstandby-enabled/27193/2 "2023-12-16T15:24:41Z")

</div>

Hi,

The ideal upgrade is to use the CLI pg\_upgrade with the **hard link** option as it is the simplest and for most situations the quickest. That being said these issues are to be kept in mind:

1. Draining application connections: Prior to all upgrades you will need to “cut” off communications between the deprecated server and application clients. Otherwise, you risk losing important data.

2. Upgrading REPLICAs: I suggest you review the documentation [here](https://www.postgresql.org/docs/current/pgupgrade.html) and read up on how rsync is used.

3. Overall Downtime: Like it or not, you’re going to have to schedule downtime. How much time is really dependent upon the architecture and what I will call “runbook” discipline.

Percona Blog References:

- [here](https://www.percona.com/blog/fast-upgrade-of-legacy-postgresql-with-minimum-downtime-using-pg_upgrade/)
- [here](https://docs.percona.com/postgresql/12/major-upgrade.html#on-debian-and-ubuntu-using-apt)
- [here](https://www.percona.com/blog/postgresql-upgrade-tricks-with-oid-columns-and-extensions/)

Hope this helps

Robert

---

<div class="post-metadata">

**Author:** ![Krish\_jobs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/krish_jobs/32/14209_2.png) [@Krish\_jobs](https://forums.percona.com/u/Krish_jobs)\
**Post date:** [December 18, 2023, 2:09am UTC](https://forums.percona.com/t/how-to-upgrade-postgresql-server-from-one-major-version-to-another-in-1-n-node-architecture-hotstandby-enabled/27193/3 "2023-12-18T02:09:17Z")

</div>

Thank you for your time and assistance. I appreciate your response and the resources you provided, Rob. They will be helpful for my reference.

---

<div class="post-metadata">

**Author:** ![Robert\_Bernier](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/robert_bernier/32/1367_2.png) [@Robert\_Bernier](https://forums.percona.com/u/Robert_Bernier)\
**Post date:** [December 18, 2023, 2:14pm UTC](https://forums.percona.com/t/how-to-upgrade-postgresql-server-from-one-major-version-to-another-in-1-n-node-architecture-hotstandby-enabled/27193/4 "2023-12-18T14:14:57Z")

</div>

Hi,  
I’m glad I could help 🙂
