Nextcloud
How to Upgrade PostgreSQL from 15 to 16
By jplee ~ Published – 2023/11/30
The new PostgreSQL 16 database has been released. There are multiple ways to upgrade from the old version 15, and the easiest one is by using the pg_lsclusters tool. Here is a quick tutorial for Ubuntu (or Debian) systems. And, please, do not forget to back up your data!
Step 1: Update packages and install the new PostgreSQL 16 database.
sudo apt update && sudo apt upgrade -y
sudo apt install postgresql-16 postgresql-server-dev-16 sudo pg_lsclusters Step 3: You need to stop the new version in order to upgrade it, using the following command.
sudo pg_dropcluster 16 main --stop sudo pg_lsclusters sudo pg_upgradecluster 15 main sudo pg_dropcluster 15 main sudo apt purge postgresql-15 postgresql-client-15 sudo pg_lsclusters Start the PostgreSQL service.
sudo systemctl start postgresql.service Finally, you can check the version of postgreSQL, using the following command.
sudo psql --version sudo su - postgres Check the new PostgreSQL version.
psql -c "SELECT version();"
After the upgrade, the vaccumdb command is use to optimize statistics and analyze the new cluster. Run the vaccumdb command to analyze the new cluster.
/usr/lib/postgresql/16/bin/vacuumdb --all --analyze-in-stages logout That’s it. You are done. It is really easy right! Happy upgrading!!!!!
Congratulations, you now have your own personal data on your own secured Nextcloud system!
We at Ahuitech create clouds systems that allow you to have complete control of your Data.
Ahuitech – Cloud Creations are always in your Control

