Re: upgrading postgres - Mailing list pgsql-novice

From Aarni Ruuhimäki
Subject Re: upgrading postgres
Date
Msg-id 200608031206.59809.aarni@kymi.com
Whole thread Raw
In response to upgrading postgres  (Ramon Orticio <rporticio@yahoo.com>)
List pgsql-novice
Hi,

Here are rough guide lines how to do this manually (FC2). Hope this helps.

( $ as postgres, # as root, paths may be different ):

Take a dump from your database(s):

$pg_dumpall -c > dump_file_for_8x

Shutdown postmaster:

Datadir out of the way:

#mv /usr/local/pgdata /usr/local/pgdata_old

Make new datadir:

#mkdir /usr/local/pgdata
#chown postgres /usr/local/pgdata

Previous install out of the way:

#mv /usr/local/pgsql /usr/local/pgsql_old

Extract your new Pg:

#gunzip postgresql-8x.tar.gz
#tar -xf postgresql-8x.tar

Configure, make and install, with --prefix=/path/ you can specify install
directory, ie. the -L swicth in initdb, default is /usr/local/pgsql/:

#cd postgresql-8x
#./configure --enable-locale --other-switches ...
#gmake
#gmake install

Initdb:

#chown -R postgres /usr/local/pgsql/
#su postgres
$/usr/local/pgsql/bin/initdb -D /usr/local/pgdata -L /usr/local/pgsql/share -E
LATIN1

(-D is your datadir, -L is where your postgres.bki resides and -E is the
default encoding)

You may also want to edit your postgresql.conf and pg_hba.conf files. For
locale and connections settings atleast perhaps.

Ok, let's start the server:

$/usr/local/pgsql/bin/postmaster -D /usr/share/pgdata -B 256 -N 128 &

-B is for buffers, -N is for number of connections, you might want to add -i
for outside connections (edit pg_hba.conf accordingly)

Finally, read your dump file in:

$psql -E template1 < dump_file_for_8x

Have fun and BR,

Aarni

On Thursday 03 August 2006 06:51, Ramon Orticio wrote:
> Dear Friends,
>
>  I'm using a readhat9 distro with postgresql7 and pgadminIII working fine.
> but when I upgraded to fedora core 4 the postgres database and pgadminIII
> are no longer running. during boot up I am prompted that there is an old
> version of postgresql inside that needs to be upgraded. I queried through
> the console using the command  $rpm -qa postgres ql   postgresql-8.0.3-1
> came out the screen.
>
>  the usr/shared/docs/postgresql/readme.rpm dist  states
>
>  " These RPMs no longer support any sort of upgrading process other than
> that documented in the regular documentation.  That isyou must dump,
> upgrade, initdb, and restore your data. Dump first, then remove the old
> server subpackage, install the new package, and restore the data from
> dump."
>
>  how do I do this. what are the necessary commands to be executed?
>
>  thank you for your concern particulary to a neophyte like me.
>
>  ramon
>
>
> ---------------------------------
> Yahoo! Music Unlimited - Access over 1 million songs.Try it free.

pgsql-novice by date:

Previous
From: John Purser
Date:
Subject: Re: upgrading postgres
Next
From: Mike Ellsworth
Date:
Subject: Synonyms