I wonder if this command is enough to update my PostgreSQL database installed with Homebrew, or if I need to run some extra commands before or after:
brew postgresql-upgrade-database
Thanks in advance.
I haven't tried it yet, before doing it I want to be sure it is the appropriate command
mv /usr/local/var/postgres /usr/local/var/postgresql@14
brew install postgresql@16
/usr/local/opt/postgresql@16/bin/pg_upgrade -b /usr/local/opt/postgresql@14/bin -B /usr/local/opt/postgresql@16/bin -d /usr/local/var/postgresql@14 -D /usr/local/var/postgresql@16
brew uninstall postgresql@14
postgresql@16
mv /usr/local/var/postgres /usr/local/var/postgresql@14
brew install postgresql@16
/opt/homebrew/Cellar/postgresql@16/16.3/bin/pg_upgrade -b /opt/homebrew/Cellar/postgresql@14/14.12/bin -B /opt/homebrew/Cellar/postgresql@16/16.3/bin -d /opt/homebrew/var/postgresql@14 -D /opt/homebrew/var/postgresql@16
brew uninstall postgresql@14
postgresql@16
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With