unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Gabriel Wicki <gabriel@erlikon.ch>
Cc: help-guix@gnu.org
Subject: Re: Upgrade postgres for cuirass
Date: Sun, 01 Dec 2024 14:23:12 +0100	[thread overview]
Message-ID: <87bjxvv8ov.fsf@gnu.org> (raw)
In-Reply-To: <7ighizgp4lsdxxqxdoufy6bqwymndnaei2tv37pcxmnbjx6bzu@mogcc4xr5hco> (Gabriel Wicki's message of "Fri, 29 Nov 2024 17:33:58 +0100")

Hi,

Thanks for this nice writeup!  Would you like to turn it into a section
of the Cuirass (or Guix) manual?

Gabriel Wicki <gabriel@erlikon.ch> skribis:

> 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

FWIW, I used the same approach on guix.bordeaux.inria.fr, which has a
relatively small database.

For ci.guix.gnu.org, which has a much bigger database, I used
‘pg_upgrade’ instead:

  https://www.postgresql.org/docs/current/pgupgrade.html

It went like this:

--8<---------------cut here---------------start------------->8---
sudo herd stop cuirass && sudo herd disable cuirass
sudo herd stop postgresql

mv /var/lib/postgresql/data{,.pg13}
sudo su - postgres -s /bin/sh -c "cd $PWD; /gnu/store/cng33vs1zdrqpmiz548kkvavc7x1xpd0-postgresql-15.8/bin/initdb -D /var/lib/postgresql/data --locale=en_US.UTF-8"

sudo su - postgres -s /bin/sh -c "cd $PWD; /gnu/store/cng33vs1zdrqpmiz548kkvavc7x1xpd0-postgresql-15.8/bin/pg_upgrade --old-datadir=/var/lib/postgresql/data.pg13 --new-datadir=/var/lib/postgresql/data --old-bindir=/gnu/store/j9wnb7rvjzxdzghpvq1jmi2zfg4z2d8c-postgresql-13.15/bin --new-bindir=/gnu/store/cng33vs1zdrqpmiz548kkvavc7x1xpd0-postgresql-15.8/bin"
--8<---------------cut here---------------end--------------->8---

The store file names are those of Postgres 13 (the one that was used so
far) and 15 (as returned by ‘guix build postgresql@15’ with the target
Guix revision).

That was a couple of hours ago.  Apparently it went well, though
postgresql is slower than before so I wonder if there are options I
forgot to pass or something.

Ludo’.


  reply	other threads:[~2024-12-01 13:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 16:33 Upgrade postgres for cuirass Gabriel Wicki
2024-12-01 13:23 ` Ludovic Courtès [this message]
2024-12-03  8:33   ` Gabriel Wicki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bjxvv8ov.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=gabriel@erlikon.ch \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).