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

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: Paul Förster <paul(dot)foerster(at)gmail(dot)com>, 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 10:23:29
Message-ID: 20200502102329.GA14178@c720-r342378
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El día viernes, mayo 01, 2020 a las 10:31:48a. m. +0200, Matthias Apitz escribió:

> Hi Paul,
>
> El día viernes, mayo 01, 2020 a las 10:23:37a. m. +0200, Paul Förster escribió:
>
> >
> > you may have a look at the tar man page. tar in Linux has the --exclude=PATTERN option.
>
> I do know the man page(s) of tar ant the --exclude=PATTERN.
>
> > You may specify the PGDATA directory there.
>
> This is, what I wanted to know: that the cluster can be moved without
> the PGDATA dir and still works fine.
>

This will not work! The cluster was created with:

$ /usr/local/sisis-pap/pgsql/bin/pg_ctl -D /data/prosgresql11/data initdb

and consequently, PGDATA is /data/prosgresql11/data. This directory contains a
lot of subirs and config files:

srap32dxr1:/home/sisis/guru # du -s /data/postgresql11/data/* | sort -n
4 /data/postgresql11/data/PG_VERSION
4 /data/postgresql11/data/pg_commit_ts
4 /data/postgresql11/data/pg_dynshmem
4 /data/postgresql11/data/pg_ident.conf
4 /data/postgresql11/data/pg_replslot
4 /data/postgresql11/data/pg_serial
4 /data/postgresql11/data/pg_snapshots
4 /data/postgresql11/data/pg_stat
4 /data/postgresql11/data/pg_tblspc
4 /data/postgresql11/data/pg_twophase
4 /data/postgresql11/data/postgresql.auto.conf
4 /data/postgresql11/data/postmaster.opts
4 /data/postgresql11/data/postmaster.pid
8 /data/postgresql11/data/pg_hba.conf
12 /data/postgresql11/data/pg_notify
16 /data/postgresql11/data/pg_logical
24 /data/postgresql11/data/postgresql.conf
28 /data/postgresql11/data/pg_multixact
196 /data/postgresql11/data/pg_subtrans
732 /data/postgresql11/data/pg_stat_tmp
940 /data/postgresql11/data/global
1328 /data/postgresql11/data/pg_xact
76076 /data/postgresql11/data/serverlog.20200414
81988 /data/postgresql11/data/pg_wal
90268 /data/postgresql11/data/serverlog
16672568 /data/postgresql11/data/base

The databases (or it least their content) are below /data/postgresql11/data/base
(because of the size of ~81 GByte).

So the question remains: What I have to move by tar to get the cluster
setup on the new host, but without the databases in it?

If this is not possible, I will only copy over the software from /usr/local/sisis-pap/pgsql/
and create the cluster from scratch.

Thanks

matthias

--
Matthias Apitz, ✉ guru(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Förster 2020-05-02 13:23:52 Re: How to move a 11.4 cluster to another Linux host, but empty?
Previous Message TalGloz 2020-05-02 07:30:53 Re: Checking for Presence of Required Libraries Fails during PostgreSQL Upgrade