From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: copy databases from two differend backups to one cluster
Date: Fri, 18 Nov 2022 09:31:33 -0600
Message-ID: <e823042a-0c55-5c32-32e6-6ef1786e2fde@gmail.com> (raw)
In-Reply-To: <CACEKkuNQ0HLAnE5YARDnetvujxJc84PdpMaiQqLqzp1rpffGHw@mail.gmail.com>
References: <CACEKkuNQ0HLAnE5YARDnetvujxJc84PdpMaiQqLqzp1rpffGHw@mail.gmail.com>
On 11/18/22 06:33, Joseph Kennedy wrote:
>
> I would like to copy databases from two different pg_basebackup backups to
> one lab environment database cluster on another server. Is it possible ?
>
> It's a good idea to do it in that way.
>
> Databases has your oid in pg_basebackup we can find it id in base
> directory for example:
>
> base/
>
> 1
>
> 125859
>
> 14042
>
> 14043
>
> 2315410
>
> 2321461
>
> 2321462
>
> 2321463
>
> Database OID (and directory name) we can find by :
>
> SELECT oid from pg_database where datname = 'database name';
>
> Steps:
>
> create empty databases on destination server (database oid they will be
> probably different then on source databases)
>
> stop Postgresql
>
> cleanup destination directories eg. 2315410, 2321461, 2321462, 2321463
>
> copy eg. content from pg_bassebackup01 base/(some OID) to 2315410 and 2321461
>
> copy eg. content from pg_bassebackup02 base/(some OID) to 2321462 and 2321463
>
> start postgresql
>
>
> Is it a good or very bad idea ?
>
Why can't you do pg_dump/pg_restore?
--
Angular momentum makes the world go 'round.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: copy databases from two differend backups to one cluster
In-Reply-To: <e823042a-0c55-5c32-32e6-6ef1786e2fde@gmail.com>
References: <CACEKkuNQ0HLAnE5YARDnetvujxJc84PdpMaiQqLqzp1rpffGHw@mail.gmail.com> <e823042a-0c55-5c32-32e6-6ef1786e2fde@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox