Upgrade Postgres.app

All these documentation is available at https://postgresapp.com but they are scattered so here is the order I followed to upgrade from Postgres 10 to 12.

Backup Data

Migrate data using pg_dumpall

This is the easiest way to migrate your data.

  1. Make sure that the old server is running
  2. Create a compressed SQL dump of your server (this could take some time):
  3. Create a folder call it postg_temp or whatever you like and run: pg_dumpall --quote-all-identifiers | gzip >postgresapp.sql.gz
  4. Stop the old server
  5. Quit Postgres.app

Uninstalling Postgres.app

  1. Quit Postgres.app & drag it to the Trash
  2. Delete the data directory (default location: ~/Library/Application Support/Postgres)
  3. Delete preferences for Postgres.app by executing the following command: defaults delete com.postgresapp.Postgres2
  4. sudo rm /etc/paths.d/postgresapp

Installing Postgres.app

  1. Download the dmg and install it as usual: just drag it to your Applications folder and double click.
  2. Once is running click in the little elephant icon in top menu and click on the initialize button.

Restore your backup

  1. start the new server.
  2. Now restore the SQL dump: gunzip <postgresapp.sql.gz | psql

JOB DONE!! You should have the latest postgres version installed on your Mac.

Comments

comments powered by Disqus