From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 6L0KDhrtSWd0gwEAe85BDQ:P1 (envelope-from ) for ; Fri, 29 Nov 2024 16:34:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6L0KDhrtSWd0gwEAe85BDQ (envelope-from ) for ; Fri, 29 Nov 2024 17:34:34 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" 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 A847B1DD2F for ; Fri, 29 Nov 2024 17:34:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH3wb-0003L7-0m; Fri, 29 Nov 2024 11:34:13 -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 1tH3wW-0003I9-OQ for help-guix@gnu.org; Fri, 29 Nov 2024 11:34:08 -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 1tH3wU-0003QW-Qb for help-guix@gnu.org; Fri, 29 Nov 2024 11:34:08 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id 9BE471FFFF for ; Fri, 29 Nov 2024 17:34:02 +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 2RfRkhsHyMVC for ; Fri, 29 Nov 2024 17:34:01 +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 for ; Fri, 29 Nov 2024 17:34:01 +0100 (CET) Date: Fri, 29 Nov 2024 17:33:58 +0100 From: Gabriel Wicki To: help-guix@gnu.org Subject: Upgrade postgres for cuirass Message-ID: <7ighizgp4lsdxxqxdoufy6bqwymndnaei2tv37pcxmnbjx6bzu@mogcc4xr5hco> 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.64 X-Spam-Score: -1.64 X-Migadu-Queue-Id: A847B1DD2F X-Migadu-Scanner: mx12.migadu.com X-TUID: 7dQtySCBmCOW 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