Up: Guix System Management [Contents][Index]
With the deprecation of the default value for the postgres package in postgresql-configuration (see b93434e656eba4260df82158a96c295000d3ff44), system upgrades need some manual action before they can take place. Here’s a handy guide on how to.
Please note that this is a straight-forward way for smaller datasets.
For larger databases
pg_upgrade
may be the better choice. Handling the service and
system upgrade as described in this guide still applies, though.
Prevent the service from starting and failing after a reconfiguration:
sudo herd stop cuirass && sudo herd disable cuirass
sudo su - postgres -s /bin/sh -c pg_dumpall > /tmp/pg.dump
Depending on whether your postgres service is defined implicitly
(through the dependency from the cuirass service) or its own entry in
your operating system’s (services)
property, you need to either
add or alter the already existing configuration to reflect your intended
version upgrade.
Be careful not to upgrade directly to postgres-16 – cuirass service for some reason doesn’t like that. I had to find and purge the relevant files and then re-initialize after a failed upgrade to postgres 16.
(service postgresql-service-type
(postgresql-configuration
(postgresql ( (gnu packages databases) postgresql-15))))
Note: If you for some reason didn’t read the text here but somewhat blindly followed the examples and did upgrade to 16, here’s how you reset the state:
They default to live under /var/lib/postgres/data.
sudo su - postgres -s /bin/sh -c 'pg_ctl init -D
/var/lib/postgres/data'
sudo guix system reconfigure path/to/your/altered/config.scm
sudo su - postgres -s /bin/sh -c 'psql -d postgres -f /tmp/pg.dump'
sudo herd enable cuirass sudo herd start cuirass
Up: Guix System Management [Contents][Index]