WebHare community

Updating your database to postgresql 13

Specifically for the Mac users:

cd $WEBHARE_DATAROOT  # see 'wh dirs' fo the proper value if needed
mv postgresql/db postgresql/db.bak
brew install postgresql@12
initdb -D postgresql/db --auth-local=trust -E 'UTF-8' --locale='en_US.UTF-8'
pg_upgrade -b /usr/local/Cellar/postgresql@12/12.4/bin/ -d postgresql/db.bak -D postgresql/db

If all seems fine, you can delete $WHDATA/postgresql/db.bak at some point

Note: The @ in the pg_upgrade command should be escaped, postgresql@12 is currently at version 12.4_1:

pg_upgrade -b /usr/local/Cellar/postgresql\@12/12.4_1/bin/ -d postgresql/db.bak -D postgresql/db

It seems we’re at 12.5 now:

brew install postgresql@12
Warning: postgresql@12 12.5 is already installed and up-to-date

Which makes the last command:

pg_upgrade -b /usr/local/Cellar/postgresql\@12/12.5/bin/ -d postgresql/db.bak -D postgresql/db