Thread: Copy a cluster from one host to an identical other

Copy a cluster from one host to an identical other

From
"Birchall, Austen"
Date:

If I want to copy a cluster from one host to an identical other (same size, disk layout etc.) am I right to assume that the can just:

 

1.       Tar up /var/lib/pgsql on the original

2.       ftp to the target

3.       Extract tarfile into /var/lib/pgsql on the target

4.       Start PostgreSQL

 

Thanks

 

Austen

 

Austen Birchall  Senior Database Administrator
Met Office
FitzRoy Road Exeter EX1 3PB United Kingdom

 

Re: Copy a cluster from one host to an identical other

From
Keith
Date:
That works yes. Just be sure to call pg_start_backup() on the master before starting the tar and then pg_stop_backup() when you're done.
You can also use the pg_basebackup tool to help make it a little easier
http://www.postgresql.org/docs/9.2/static/app-pgbasebackup.html

On Fri, Sep 26, 2014 at 10:32 AM, Birchall, Austen <austen.birchall@metoffice.gov.uk> wrote:

If I want to copy a cluster from one host to an identical other (same size, disk layout etc.) am I right to assume that the can just:

 

1.       Tar up /var/lib/pgsql on the original

2.       ftp to the target

3.       Extract tarfile into /var/lib/pgsql on the target

4.       Start PostgreSQL

 

Thanks

 

Austen

 

Austen Birchall  Senior Database Administrator
Met Office
FitzRoy Road Exeter EX1 3PB United Kingdom

 


Re: Copy a cluster from one host to an identical other

From
"Birchall, Austen"
Date:

Hi again

Actually I meant to said the original is a non WAL mode dev cluster so I will shut it down before starting the tar.

Also I would use pgdump but there is a known issue with this potentially not working with version of the application we are using & Postgres 8.4 (yes, an upgrade Project is underway!!!)

 

Austen

 Austen Birchall  Senior Database Administrator
Met Office
FitzRoy Road Exeter EX1 3PB United Kingdom

 

 

Re: Copy a cluster from one host to an identical other

From
Keith
Date:
If you're shutting it down completely, then yes, just tar'ing and copying should work as long as the destination is a similar architecture (you can't go from a 32-bit to a 64-bit system with a file copy).

On Fri, Sep 26, 2014 at 11:27 AM, Birchall, Austen <austen.birchall@metoffice.gov.uk> wrote:

Hi again

Actually I meant to said the original is a non WAL mode dev cluster so I will shut it down before starting the tar.

Also I would use pgdump but there is a known issue with this potentially not working with version of the application we are using & Postgres 8.4 (yes, an upgrade Project is underway!!!)

 

Austen

 Austen Birchall  Senior Database Administrator
Met Office
FitzRoy Road Exeter EX1 3PB United Kingdom