Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUQxZ-0006EP-UK for pgsql-general@arkaria.postgresql.org; Fri, 01 May 2020 08:23:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jUQxX-0002Is-W7 for pgsql-general@arkaria.postgresql.org; Fri, 01 May 2020 08:23:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUQxX-0002Il-M1 for pgsql-general@lists.postgresql.org; Fri, 01 May 2020 08:23:47 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jUQxR-0001aK-D0 for pgsql-general@lists.postgresql.org; Fri, 01 May 2020 08:23:46 +0000 Received: by mail-wm1-x343.google.com with SMTP id u16so5564922wmc.5 for ; Fri, 01 May 2020 01:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6EPYdCGsxe/+b3im7PNWwGvfDpiMs0DsZvQPSGrCU0Y=; b=nBbtJGs7ni4YYoi2N3omHa6iwn6pSWEJQUJeoVs36/beQVNv9lF22KIZytu7cqxMeP 4WhQzdM93Pix3x3gO9vid/D3ixLY0xHhGmFn58sWyv45psJ3NsAPaTr65e8VPQavsIOb HuM7+yuQfNVMoG+mzO2FPPrJXKeDeO6o07ZMgUmUZU8nbIYxOMlNXBLeoaZ9KwW2u9Xx Lt4Or83SLuRDNRHu54H9kKi0TBwQmU1+E7JyUx4xw6rnnL21/3BHofsKRLaUjyTqkQXx 4Ul6OAUI6VDzggIdll214n0JgFJFqGTOc/sFfqKbl9Cjl0xsPIMa/kC2FNO2yBm+/PTT PrUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6EPYdCGsxe/+b3im7PNWwGvfDpiMs0DsZvQPSGrCU0Y=; b=LPDjXaFRUh5QSJiw+RAZzu6DMCODDLzlA5kkRJSNZJDw5DNvxPdLj+fI2S8J5ivCBf j+xMDcss/SuWMahmA5+GeuIa+FJUUTDsurlqtCwEezhWnD7b0+z+cIdSEicKNMf6vBZA ZX5acKH53eShz/PUz+p3gDmtPaC2f5sUZ6D/Tyofh9uThTTz8C6Yi3BXfCrpqd126FBx c9IB/KeLFKsh8fzwTJF+BHXgDW7xDydzxHqGxnlVghgFwLAlKcyFRPrhHloff6pFrv0I w7B3zSwlmj+/GaYwKRdrtrZaXEfjNef/fBxZewvmeq3xnwqRdilZ6zYbY1O3eyI2lOqT uHag== X-Gm-Message-State: AGi0PuYDKtN5Fbmt/zVi09GOhxch6m+AM7/xPQmK+esiWFRx/CodGMIj +TKzGGn980L2KL3w5CbRC2E= X-Google-Smtp-Source: APiQypIiSHavL1Hnk5j8DCAHWr6WbbDzfrS/6u7uPAMJO3hPho8Y5EYFukIumAFamr57dO/9lOIV8Q== X-Received: by 2002:a1c:2d02:: with SMTP id t2mr2838131wmt.98.1588321418999; Fri, 01 May 2020 01:23:38 -0700 (PDT) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id j22sm3340664wre.84.2020.05.01.01.23.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 May 2020 01:23:38 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: How to move a 11.4 cluster to another Linux host, but empty? From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: <20200501081029.GA3261@c720-r342378> Date: Fri, 1 May 2020 10:23:37 +0200 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <999AE92C-F74D-4399-8FE1-1DB80D08915D@gmail.com> References: <20200501081029.GA3261@c720-r342378> To: Matthias Apitz X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Matthias, > On 01. May, 2020, at 10:10, Matthias Apitz wrote: >=20 >=20 > Hello, >=20 > I've a 11.4 cluster on a Linux host with 3 production database, all > below /data/postgresql11.4/ (i.e. the cluster itself is > /data/postgresql11.4/data) fully configured an running fine. I want to > move it "cold" (i.e. when it is shutdown) by tar to another host, BUT > without the database (due to PII and GDPR relevant data). Between the > source and target host there is no network. >=20 > Of course I could, after moving all the PostgreSQL software (all is = below a top > level directory /usr/local/sisis-pap/pgsql, compiled by me) and setup = the > cluster from scratch on the other host, but I wanted to have it all in = one shoot by tar. >=20 > Is there a way to exclude the databases from the move by tar, or by = some > sophisticated pg_* command? >=20 > Thanks >=20 > matthias you may have a look at the tar man page. tar in Linux has the = --exclude=3DPATTERN option. You may specify the PGDATA directory there. Alternatively you may specify each directory inside the software = directory without explicitly specifying subdirectories to include: tar cvf postgresql11.4.tar /data/postgresql11.4/bin = /data/postgresql11.4/share ... Also, why do you have the PGDATA directory inside the software home = directory? That makes no sense and only leads to problems when updating = or, in your case, moving. We use: /data/postgres/xx.x <=3D with xx.x as PostgreSQL = version /data// <=3D as PGDATA This way, we never have any trouble doing something with the software or = database cluster independently from each other. Hope, this helps. Cheers, Paul