![]() ![]() The old server and client packages are no longer supported.Īfter the existing clusters are upgraded, the postgresql-12 and postgresql-client-12 packages should be removed. If you want to upgrade the 12/main cluster, you need to remove the already existing 13 cluster ( pg_dropcluster -stop 13 main, see manpage for details). Please be aware that the installation of postgresql-13 will automatically create a default cluster 13/main. Please install the latest packages ( postgresql-13 and postgresql-client-13) and upgrade the existing clusters with pg_upgradecluster (see manpage). The PostgreSQL version 12 is obsolete, but the server or client packages are still installed. Upgrade PostgreSQL ¶ĭuring Ubuntu updgrade to 21.04 you receive this message “Configuring postgresql-common”: You can also drop the pristine database from the newer version as well.This article is aimed at those like me who use Ubuntu and PostgreSQL to develop locally on their computer and after the last update to Ubuntu 21.04 they have two versions of PostgreSQL installed. Optionally, you can drop the old cluster once you've verified the new one works and you don't need the old cluster anymore. You should also see that the old cluster is down and the new version of Postgres is up: $ pg_lsclustersġ4 main 5434 down postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.logġ5 main 5432 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.logġ5 main_pristine 5433 online postgres /var/lib/postgresql/15/main_pristine /var/log/postgresql/postgresql-15-main_pristine.log We can start Postgres back up again and this time it should be running the new postgres 15 cluster. Replace the version (14) here with the old version of Postgres that you're currently using. Upgrade the old cluster to the latest version sudo pg_renamecluster 15 main main_pristineĤ. We need to rename the new postgres cluster so that when we upgrade the old cluster the names won't conflict. When Postgres packages install, they create a default cluster for you to use. ![]() Rename the new Postgres version's default cluster Stop Postgres before we make any changesįirst thing's first, we need to stop any services using postgres so we can safely migrate our database. Ver Cluster Port Status Owner Data directory Log fileġ4 main 5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.logġ5 main 5433 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.logĢ. You can also list the clusters that are on your machine by running $ pg_lsclusters To find the installed versions that you currently have on your machine, you can run the following: $ dpkg -get-selections | grep postgres Otherwise if you want to upgrade to the very latest Postgres version, you can follow the instructions on their website here: If you're using the default version available on Ubuntu, you can just upgrade to the latest postgres by running the following: sudo apt-get upgrade This only takes a couple minutes if you have a small database, so let's get started! 1. In this example, I'm upgrading Postgres 14 to Postgres 15 but all you have to do is replace the version numbers in the commands below to match which old version you're using and the new version you're upgrading to. It doesn't matter which version you're upgrading from or to. We're going to be upgrading PostgreSQL server on Ubuntu in this guide. ![]() Upgrading PostgreSQL Version on Ubuntu Server Overview
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |