Re: Starting new cluster from base backup

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Guillaume Drolet <droletguillaume(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Starting new cluster from base backup
Date: 2015-02-17 22:14:35
Message-ID: 54E3BD4B.9080506@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/17/2015 06:54 AM, Guillaume Drolet wrote:
> Adrian: thanks for this information.
>
> I tried running pg_basebackup in plain format with option -X stream
> (pg_basebackup -D "F:\208376PT\db" -X stream -l "208376PT17022015" -U
> postgres -P) but I got the message:
>
> pg_basebackup: directory "E:\Data\Database" exists but is not empty"
>
> I creatde a tablespace using CREATE TABLESPACE at the location mentioned
> in the message. According to what I read online about this, this message
> is issued when a tablespace was created under PGDATA. In my case, only
> the directory junction pointing to my tablespace (on a different drive
> than PGDATA) exists under PGDATA, not the tablespace itself.
>
> The only way I can run pg_basebackup with WAL files is with option -Ft
> and -X fetch. I'd much prefer using plain mode since my 670 GB
> tablespace takes a lot of time to extract when tarred. Is there another
> way to approach this?

All I can come up with at the moment:

So what is the path on the original machine and can it be replicated on
the new machine, at least temporarily?

I'm thinking if the path can be replicated, let pg_basebackup write to
it and then create the tablespace you want and do ALTER TABLE SET
TABLESPACE to move the tables. You would also need to do this for indexes.

>
> Thanks.
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Boyle 2015-02-17 22:37:43 BDR Monitoring, missing pg_stat_logical_decoding view
Previous Message Adrian Klaver 2015-02-17 22:10:24 Re: Starting new cluster from base backup