# Looking an upgrade plan for posgreSQL 9.3/postgis 2.1 to latest possible versions

**URL:** <https://forums.percona.com/t/looking-an-upgrade-plan-for-posgresql-9-3-postgis-2-1-to-latest-possible-versions/9228>\
**Category:** PostgreSQL General Discussion\
**Created:** [February 11, 2021, 1:51pm UTC](https://forums.percona.com/t/looking-an-upgrade-plan-for-posgresql-9-3-postgis-2-1-to-latest-possible-versions/9228 "2021-02-11T13:51:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ja2027](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@ja2027](https://forums.percona.com/u/ja2027)\
**Post date:** [February 11, 2021, 1:51pm UTC](https://forums.percona.com/t/looking-an-upgrade-plan-for-posgresql-9-3-postgis-2-1-to-latest-possible-versions/9228/1 "2021-02-11T13:51:28Z")

</div>

I am currently using PostgreSQL 9.3/PostGIS2.1. I want to upgrade to PG13. Could we able to upgrade to 13.x directly? Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![Jobin\_Augustine](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jobin_augustine/32/1275_2.png) [@Jobin\_Augustine](https://forums.percona.com/u/Jobin_Augustine)\
**Post date:** [February 15, 2021, 11:28am UTC](https://forums.percona.com/t/looking-an-upgrade-plan-for-posgresql-9-3-postgis-2-1-to-latest-possible-versions/9228/2 "2021-02-15T11:28:06Z")

</div>

Hi @ja2027 , Yes you can upgrade to any latest version of PostgreSQL using pg\_upgrade directly. The relevant version of extensions (including PostGIS) on the new PostgreSQL version must be installed prior to the migration.

---

<div class="post-metadata">

**Author:** ![Saurabh\_Sharma](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/saurabh_sharma/32/5611_2.png) [@Saurabh\_Sharma](https://forums.percona.com/u/Saurabh_Sharma)\
**Post date:** [January 18, 2022, 4:56am UTC](https://forums.percona.com/t/looking-an-upgrade-plan-for-posgresql-9-3-postgis-2-1-to-latest-possible-versions/9228/3 "2022-01-18T04:56:14Z")

</div>

Hello @ja2027, As @Jobin_Augustine Jobin said you can upgrade your PostgreSQL cluster using pg\_upgrade directly, however, it will be possible only if you are ok with dropping the Postgis extension and recreating it after the upgrade.  
But if dropping and re-creating the Postgis is not an option for you, then I would suggest you to following the below upgrade path.

1. At first, upgrade your Postgis extension from Postgis 2.1 to Postgis 2.4.
2. The next step will be to upgrade your PostgreSQL cluster from 9.3 to PostgreSQL 11.
3. Then again upgrade your Postgis from 2.4 to Postgis 3.1 / 3.2.
4. And, finally now you can upgrade your PostgreSQL from PostgreSQL 11 to PostgreSQL 13 version.

The above upgrade path needs to be followed because Postgis 2.1 is not supported on PostgreSQL 13 version and a direct upgrade with an extension present on the database will result in an error.  
The support Matrix of the Postgis version and PostgreSQL version can be found over the below link.

[[Support Matrix Postgis and PostgreSQL]](https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS)
