Re: How to move a 11.4 cluster to another Linux host, but empty?

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: Matthias Apitz <guru(at)unixarea(dot)de>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to move a 11.4 cluster to another Linux host, but empty?
Date: 2020-05-02 14:37:17
Message-ID: D880DDEF-E279-4D27-BF3D-AB231FBBA69C@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Matthias,

> On 02. May, 2020, at 16:30, Matthias Apitz <guru(at)unixarea(dot)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, on the new host, do an initdb and after that, copy the old config files into the new PGDATA. Then start the new (empty and free of databases) database cluster.

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

Cheers,
Paul

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-05-02 14:59:50 Re: How to move a 11.4 cluster to another Linux host, but empty?
Previous Message Matthias Apitz 2020-05-02 14:30:31 Re: How to move a 11.4 cluster to another Linux host, but empty?