* Upgrade postgres for cuirass
@ 2024-11-29 16:33 Gabriel Wicki
0 siblings, 0 replies; only message in thread
From: Gabriel Wicki @ 2024-11-29 16:33 UTC (permalink / raw)
To: help-guix
Aloha, howdy and hello!
This isn't your usual call for help - this is my help to you! Since
postgres was recently unset all of us running cuirass on default
postgres versions need to take some action. Since I guess a bunch of
users will be affected, I summarized the necessary steps in hope to
help before you have to ask. It may contain errors, mistakes or false
promises, use at your own risk.
This is for all of you who know perfectly well that they will figure out
how to do it but still prefer to do some of the tasks on the stack in a
sheepishly follow the tutorial step-by-step fashion. I know I am like
that with far too many of the tasks piling up on my virtual task-heap.
So here it is, my tiny writeup on how to upgrade postgres for cuirass
to continue working. It's actually kinda easy.
1. Stop and disable cuirass (to prevent it from starting and failing
after a reconfiguration):
sudo herd stop cuirass && sudo herd disable cuirass
2. Dump the database contents. Ever too often (I tend to be somewhat
dense) I forget how to access postgres privileged content. Don't
be like me.
sudo su - postgres -s /bin/sh -c pg_dumpall > /tmp/pg.dump
3. Add the postgres service to your system configuration - 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 and then re-initialize after a failed
upgrade to postgres 16.
#+begin_quote
(service postgresql-service-type
(postgresql-configuration
(postgresql (@ (gnu packages databases) postgresql-15))))
#+end_quote
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:
a) Delete the database instance files; they default to live under
/var/lib/postgres/data.
b) Re-initialize:
sudo su - postgres -s /bin/sh -c 'pg_ctl init -D /var/lib/postgres/data'
4. Reconfigure your system.
sudo guix system reconfigure path/to/your/altered/config.scm
5. Restore database contents:
sudo su - postgres -s /bin/sh -c 'psql -d postgres -f /tmp/pg.dump'
6. Enable and start the service(s)
sudo herd enable cuirass
sudo herd start cuirass
That's it, fellow guix!
Happy hacking and have a nice weekend!
gabber
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-29 16:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-29 16:33 Upgrade postgres for cuirass Gabriel Wicki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).