Re: How to move a 11.4 cluster to another Linux host, but empty? - Mailing list pgsql-general

From Paul Förster
Subject Re: How to move a 11.4 cluster to another Linux host, but empty?
Date
Msg-id D880DDEF-E279-4D27-BF3D-AB231FBBA69C@gmail.com
Whole thread Raw
In response to Re: How to move a 11.4 cluster to another Linux host, but empty?  (Matthias Apitz <guru@unixarea.de>)
List pgsql-general
Hi Matthias,

> On 02. May, 2020, at 16:30, Matthias Apitz <guru@unixarea.de> wrote:
>
> El día sábado, mayo 02, 2020 a las 03:23:52p. m. +0200, Paul Förster escribió:
>
>> /usr/local/sisis-pap/pgsql  <= software with bin, lib64, share, etc...
>> /data/postgresql11/data     <= PGDATA
>
> Exactly, his is the setup above.
>
> I will move /usr/local/sisis-pap/pgsql by tar; and I want to move some parts(!)
> of the cluster /data/postgresql11/data (configuration etc.), but not the databases
> included in /data/postgresql11/data, like the cluster(!) in PGDATA was before having
> created any database(!) in it.
>
> As I said from the beginning: moving the cluster but without the
> databases in it.

you don't want to move the database cluster in this case!

Add the database cluster's config files postgresql.conf, pg_hba.conf, pg_ident.conf or whatever to the tar file. Then,
onthe new host, do an initdb and after that, copy the old config files into the new PGDATA. Then start the new (empty
andfree of databases) database cluster. 

So:
tar cvf /tmp/postgresql11.tar /usr/local/sisis-pap/pgsql /data/postgresql11/*.conf

Cheers,
Paul


pgsql-general by date:

Previous
From: Matthias Apitz
Date:
Subject: Re: How to move a 11.4 cluster to another Linux host, but empty?
Next
From: Adrian Klaver
Date:
Subject: Re: How to move a 11.4 cluster to another Linux host, but empty?