pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zoltan Szecsei <zoltans@geograph.co.za>
To: pgsql-admin@postgresql.org
Subject: connect postgresql to a different cluster
Date: Thu, 07 May 2015 18:27:13 +0200
Message-ID: <554B9261.9080305@geograph.co.za> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Hi,
My question refers to a newly installed postgresql 9.4 on ubuntu 15.04.

Is it possible to mount a file system with an existing 9.4 version 
postgresql cluster onto a new machine and get a fresh postgresql install 
to connect to that cluster?

When I installed postgresql it created a /var/lib/postgrersql/9.4/main 
cluster, and pointed to it via /etc/postgresql/9.4/main

I then mounted a HD with an existing v9.4 postgresql cluster called 
gisdata at /mnt/geo_pgsql/postgres.
Note that I have no /etc/postgresql/9.4/gisdata directory. (I forgot to 
back it up before reinstalling ubuntu)

initdb -D /mnt/geo_pgsql/postgres will clobber my existing gisdata 
cluster, will it not?

So is there a way to move a cluster to another (same version) postgreql 
installation?

Just for giggles I tried copying the /etc/postgresql/9.4/main folder to 
/etc/postgresql/9.4/gisdata and hacking the contents therein, but that 
never worked.

Googling around and reading installation guides only comes up with 
creating new clusters.
I doubt if setting the PGDATA variable  (where is that set???) will help 
as the /etc/postgresql/9.4/gisdata is missing.

A thought is to change the name of this cluster to xxx, create the 
cluster again, delete it and mv xxx back to this name.

But maybe there is an elegant way to "import" a cluster?


TIA,
Zoltan

-- 

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
GIS and Photogrammetric Services

P.O. Box 7, Muizenberg 7950, South Africa.

Mobile: +27-83-6004028
Fax:    +27-86-6115323     www.geograph.co.za
===========================================



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (4+ messages)  latest in thread

Message-ID: <554B9261.9080305@geograph.co.za>
Permalink:  ../554B9261.9080305@geograph.co.za/
Also on:    postgresql.org/message-id/554B9261.9080305@geograph.co.za

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: zoltans@geograph.co.za
  Subject: Re: connect postgresql to a different cluster
  In-Reply-To: <554B9261.9080305@geograph.co.za>

* 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