From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eBn/MiIUV2ekeAAAqHPOHw:P1 (envelope-from ) for ; Mon, 09 Dec 2024 16:00:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id eBn/MiIUV2ekeAAAqHPOHw (envelope-from ) for ; Mon, 09 Dec 2024 17:00:34 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=v44ZJvcJ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733760034; a=rsa-sha256; cv=none; b=syRJGhSHN8k+mmsS+6orwkmpisrDDaXWbFIr/scDLZ4IMahuLf3G8fH5NUKKW+cYXaTrmG gIHGxufZs1i6pG4CFHD3ZCBYm+DCJOmHQFR/IjKx/hrp/XrI//I2K5T8fvveAZDICCEYjW 6C5rHsRrKamXh30dhI1SIPnbAH83XH4xYh30IstDW/6fUzg2P0NHEyIWLONGdRYLeLfDSK 5JZKm+KOC2V2iztVPAIFMR5ME+TpdzpDxLNYsZaaUg/BvwqCvXzpYFGy6CJgf8+vfF/DKI QPMbG5UDm1pWXecjm3eduBQcwBKPJ3hhCMIIbyesRZrWMfqzzuCoWoTxbBvSmQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=v44ZJvcJ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733760034; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=Hm88uy//R/davu93TAEIonZlVL5jjFgv9riNN716V5Q=; b=Fb34qbQCe2k7mtoEYB37u6WyfapX53cPysGxv6ZjHhqMfsRqZKQe9C92fBJGbGUGfQ6aNd 9VdeazvaPy/Wp94PFkUu49j7zQBh+/qv4ONymhs8OeSXS4xTMPfparUdmulGnoDsO83moA oDtLv9vXTe0ZL9vVccwYUqqETWCivib8UoK+/dVE8GCR7yLtHZrgNcD6ldAPbXugYedNmw 0LXw2TJKEIlV5pGxPH9C97x6tUpU8BxnTq0061yGavT77uKvf3QMy8aMOdALRLN2N8I20r WzapokOssdqnZPYXpaQU1Esp4FUAisNf4gZ5j5C/1K69TIrdyukJ7coZsrTuZg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 59619364F7 for ; Mon, 09 Dec 2024 17:00:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKgB5-0002GX-Ml; Mon, 09 Dec 2024 11:00:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKgB1-0002Ds-1P for guix-patches@gnu.org; Mon, 09 Dec 2024 11:00:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKgB0-00006W-I1 for guix-patches@gnu.org; Mon, 09 Dec 2024 11:00:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:From:Date:To:Subject; bh=Hm88uy//R/davu93TAEIonZlVL5jjFgv9riNN716V5Q=; b=v44ZJvcJ+U/bp5nD0f9JP+Jp/GtZT2vs9Jd4Pas4WSgpGHnl8arRb3HN2JGGM2wyBxw7FBwt0/yUkyvwrNi52Fes1R3xO/rDTAr0u0VUyjmNo0uUmarvB3AusbYb9mgO/cSj4l6atzofl8eO0veC1HZ53w2IN6wFAQD7FMY3V1kZXPKWi1dWgxeewg94qJ6QXjmPfse0qcB1i+z4sAWm/S14LQGL16f4Zxx6Wf1b625g2Kt0sjcaPu1sGnWuyLMq+fmpSF5NzWS+ASW7AznmpSCUD2ggdA9At8jFqKsLP4wu5rpRfkrInVcbdueJRX9yueXVn0LCBVErg1qt677VBQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKgAz-0004ny-VV for guix-patches@gnu.org; Mon, 09 Dec 2024 11:00:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74751] [PATCH] doc: cookbook: Document postgres upgrade for cuirass. Resent-From: Gabriel Wicki Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 16:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74751 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74751@debbugs.gnu.org Cc: ludo@gnu.org, maxim.cournoyer@gmail.com X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173375998518399 (code B ref -1); Mon, 09 Dec 2024 16:00:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Dec 2024 15:59:45 +0000 Received: from localhost ([127.0.0.1]:55255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKgAj-0004mh-0h for submit@debbugs.gnu.org; Mon, 09 Dec 2024 10:59:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:38088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKgAe-0004mU-Fc for submit@debbugs.gnu.org; Mon, 09 Dec 2024 10:59:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKgAe-0002Bd-6I for guix-patches@gnu.org; Mon, 09 Dec 2024 10:59:40 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKgAb-00004r-Ck; Mon, 09 Dec 2024 10:59:39 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id E08AE1FF89; Mon, 9 Dec 2024 16:59:31 +0100 (CET) X-Virus-Scanned: by amavisd at antispam.ee.ethz.ch Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]) by localhost (antispam.ee.ethz.ch [129.132.2.16]) (amavisd-new, port 10028) with ESMTP id CJnrAFlHHtV8; Mon, 9 Dec 2024 16:59:26 +0100 (CET) Received: from blackbox (212-51-128-25.fiber7.init7.net [212.51.128.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: gabriel) by cotopaxi.ee.ethz.ch (Postfix) with ESMTPSA; Mon, 9 Dec 2024 16:59:26 +0100 (CET) Date: Mon, 9 Dec 2024 16:59:20 +0100 From: Gabriel Wicki Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: permerror client-ip=129.132.148.196; envelope-from=gabriel@erlikon.ch; helo=cotopaxi.ee.ethz.ch X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.77 X-Spam-Score: -2.77 X-Migadu-Queue-Id: 59619364F7 X-Migadu-Scanner: mx12.migadu.com X-TUID: A5EqSF0HxBD/ * doc/guix-cookbook.texi(System Management): New chapter. [Upgrade Postgres for Cuirass] New node. Change-Id: I23aae16b1f50b6c40c56b78712dfd6eae3834761 --- doc/guix-cookbook.texi | 103 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index bbc5ca9dcd..57e39f12d9 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -86,6 +86,7 @@ Top * Software Development:: Environments, continuous integration, etc. * Environment management:: Control environment * Installing Guix on a Cluster:: High-performance computing. +* Guix System Management:: System Management specifics. * Acknowledgments:: Thanks! * GNU Free Documentation License:: The license of this document. @@ -199,6 +200,10 @@ Top * Cluster Disk Usage:: Disk usage considerations. * Cluster Security Considerations:: Keeping the cluster secure. +Guix System Management + +* Upgrade Postgres for Cuirass:: How to handle deprecation of the default postgres package. + @end detailmenu @end menu @@ -5524,6 +5529,104 @@ Cluster Security Considerations This will report whether profiles exist that refer to this specific glibc variant. +@c ********************************************************************* +@node Guix System Management +@chapter Guix System Management +@cindex system management +@cindex sysadmin + +Since Guix does not handle packaging, system configuration and services +the way other (more ``classical'') distributions do, some workflows tend +to unfold slightly different as we are used to and need slight +adjustment. This chapter intends to help with such manners. + +@menu +* Upgrade Postgres for Cuirass:: Upgrading from the default postgres. +@end menu + +@node Upgrade Postgres for Cuirass +@section Upgrade Postgres for Cuirass + +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 +@url{https://www.postgresql.org/docs/current/pgupgrade.html, +@code{pg_upgrade}} may be the better choice. Handling the service and +system upgrade as described in this guide still applies, though. + +@enumerate +@item +Stop and disable cuirass. + +Prevent the service from starting and failing after a reconfiguration: + + @code{sudo herd stop cuirass && sudo herd disable cuirass} + +@item +Dump the database contents. + + @code{sudo su - postgres -s /bin/sh -c pg_dumpall > /tmp/pg.dump} + +@item +Add or alter the postgres service. + +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 @code{(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. + +@lisp +(service postgresql-service-type + (postgresql-configuration + (postgresql (@ (gnu packages databases) postgresql-15)))) +@end lisp + +Note: If you for some reason didn't read the text here but somewhat +blindly followed the examples and @emph{did upgrade to 16}, here's how +you reset the state: + +@enumerate +@item +Delete the database instance files. + +They default to live under @file{/var/lib/postgres/data}. + +@item +Re-initialize postgres. + +@code{sudo su - postgres -s /bin/sh -c 'pg_ctl init -D +/var/lib/postgres/data'} +@end enumerate + +@item +Reconfigure your system. + +@code{sudo guix system reconfigure path/to/your/altered/config.scm} + +@item +Restore database contents. + +@code{sudo su - postgres -s /bin/sh -c 'psql -d postgres -f /tmp/pg.dump'} + +@item +Enable and start the service. + +@example +sudo herd enable cuirass +sudo herd start cuirass +@end example + +@end enumerate + @c ********************************************************************* @node Acknowledgments base-commit: 9d09b0cf841fb657a1aec12e9bab68e00c2b493c -- 2.46.0