pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedconnect postgresql to a different cluster
4+ messages / 3 participants
[nested] [flat]
* connect postgresql to a different cluster
@ 2015-05-07 16:27 Zoltan Szecsei <zoltans@geograph.co.za>
0 siblings, 2 replies; 4+ messages in thread
From: Zoltan Szecsei @ 2015-05-07 16:27 UTC (permalink / raw)
To: pgsql-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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: connect postgresql to a different cluster
@ 2015-05-07 16:39 David G. Johnston <david.g.johnston@gmail.com>
parent: Zoltan Szecsei <zoltans@geograph.co.za>
1 sibling, 0 replies; 4+ messages in thread
From: David G. Johnston @ 2015-05-07 16:39 UTC (permalink / raw)
To: Zoltan Szecsei <zoltans@geograph.co.za>; +Cc: pgsql-admin
On Thu, May 7, 2015 at 9:27 AM, Zoltan Szecsei <zoltans@geograph.co.za>
wrote:
> But maybe there is an elegant way to "import" a cluster?
>
βIt should possible to accomplish your goal without performing "initdb"β -
though you may find it easier to forgo the Ubuntu utilities and just write
the necessary pg_ctl commands yourself. You indeed need to use either
"$PGDATA" or explicit command line parameters and just point directly at
the cluster data directory that you mounted - with pg_ctl, not initdb.
Whether that is easier than a simple pg_dump/pg_restore β"import" it up for
you to decide.
You might be able to rename things to match the expected structure for the
Ubuntu cluster commands.
David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: connect postgresql to a different cluster
@ 2015-05-07 17:32 Zoltan Szecsei <zoltans@geograph.co.za>
parent: Gilberto Castillo <gilberto.castillo@etecsa.cu>
0 siblings, 0 replies; 4+ messages in thread
From: Zoltan Szecsei @ 2015-05-07 17:32 UTC (permalink / raw)
To: gilberto.castillo@etecsa.cu; +Cc: pgsql-admin
Hi,
Thanks to David and Gilberto for the input.
All sorted and working.
Kind regards,
Zoltan
On 2015/05/07 20:02, Gilberto Castillo wrote:
>
>> 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?
> Use:
> pg_ctl -D /mnt/geo_pgsql/postgres -l /tmp/logfile start
>
> Saludos,
> Gilberto Castillo
> ETECSA, La Habana, Cuba
>
>
> ---
> This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu
> Visit our web-site: <http://www.kaspersky.com;, <http://www.viruslist.com;
--
===========================================
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
===========================================
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: connect postgresql to a different cluster
@ 2015-05-07 18:02 Gilberto Castillo <gilberto.castillo@etecsa.cu>
parent: Zoltan Szecsei <zoltans@geograph.co.za>
1 sibling, 1 reply; 4+ messages in thread
From: Gilberto Castillo @ 2015-05-07 18:02 UTC (permalink / raw)
To: Zoltan Szecsei <zoltans@geograph.co.za>; +Cc: pgsql-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?
Use:
pg_ctl -D /mnt/geo_pgsql/postgres -l /tmp/logfile start
Saludos,
Gilberto Castillo
ETECSA, La Habana, Cuba
---
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu
Visit our web-site: <http://www.kaspersky.com;, <http://www.viruslist.com;
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2015-05-07 18:02 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-05-07 16:27 connect postgresql to a different cluster Zoltan Szecsei <zoltans@geograph.co.za>
2015-05-07 16:39 ` David G. Johnston <david.g.johnston@gmail.com>
2015-05-07 18:02 ` Gilberto Castillo <gilberto.castillo@etecsa.cu>
2015-05-07 17:32 ` Zoltan Szecsei <zoltans@geograph.co.za>
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