Thread: Upgrading from 7.1.3 to 7.2.3

Upgrading from 7.1.3 to 7.2.3

From
"Aurangzeb M. Agha"
Date:
I'm having a horrible time trying to upgrade from 7.1.3 on our Linux RH
7.2 box to the latest version.

I first tried "up2date", which failed as it didn't even know there was ANY
update available for Postgres.

I then downloaded the new TAR for 7.2.3 and walked through the upgrade
steps in pg_upgrade.1, only to be brought to a screaching halt in step 2
of the upgrade:

    $ pg_upgrade -2
    pg_upgrade is for PostgreSQL version 7.2
    but /usr/local/G101/CMS/App/DB/PG_VERSION contains 7.1.
    Did you run initdb for version 7.1 by mistake?

When I found the NEW PgSQL bin, I re-ran initdb.  However, running
'pg_upgrade -2' gave me:

    Unable to find pg_resetxlog in your path.
    Install it from pgsql/contrib/pg_resetxlog and continue.  Exiting.

I put pgsql/contrib/pg_resetxlog in the new PgSQL bin
(/usr/local/pgsql/bin) but when I try to run pg_upgrade -2, I get:

    Locales do not match between the two versions.  Exiting.

What does that mean?  What do I do to get around it?

The (old) RPM's I have on my system are:

    $ rpm -qa | grep -i postgres
    postgresql-contrib-7.1.3-2
    postgresql-tk-7.1.3-2
    postgresql-libs-7.1.3-2
    postgresql-server-7.1.3-2
    postgresql-docs-7.1.3-2
    postgresql-tcl-7.1.3-2
    postgresql-7.1.3-2
    postgresql-jdbc-7.1.3-2

I'm ready to do the upgrade anyway possible, using pg_upgrade, not using
it, whatever.

If I do a new install, do I need to remove all the RPM installation I
already have on my machine?  What about everything that got installed
during the upgrade process?

Any help would be appreciated.

    Thanks in Advance,
    Aurangzeb


Re: Upgrading from 7.1.3 to 7.2.3

From
Neil Conway
Date:
"Aurangzeb M. Agha" <aagha@bigfoot.com> writes:
> I'm ready to do the upgrade anyway possible, using pg_upgrade, not using
> it, whatever.

My suggestion would be to:

        (1) Start up the 7.1 postmaster

        (2) Make a plaintext dump of your databases using pg_dumpall

        (3) Shutdown 7.1, remove the 7.1 RPMs

        (4) Download the 7.2 source, compile and install it

        (5) Run the 7.2 initdb

        (6) Load the 7.1 dump file into your new db using 'psql -f
            ...'

There are plenty of variations on this -- see the documentation here:

        http://developer.postgresql.org/docs/postgres/migration.html



Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

Re: Upgrading from 7.1.3 to 7.2.3

From
Justin Clift
Date:
Hi Aurangzeb,

First and *most important question*... have you backed up your data?  Do
so *first*.  :)

From everything you've said here, the safest approach will probably be
to extract all of your data with the 'pg_dumpall' command, get 7.2.3
installed, then reload your data.

If this sounds alright to you, then try this:

1) Make sure that your old version of PostgreSQL is running

2) Extract/dump your data to a file

$ pg_dumpall > somefile

3) Uninstall your old version of PostgreSQL (version 7.1.3 in your case)

4) Delete the old database storage files, you don't need them any more

5) Install the new version of PostgreSQL (version 7.2.3 in this case)

6) Initialise a new database storage area:

$ PGDATA=/some/empty/directory/location
$ export PGDATA
$ initdb

7) Start the new version of PostgreSQL to check it works.  It should
startup fine.

8) Load your data base into the database

$ psql template1 < somefile

If that all worked, you should now configure PostgreSQL 7.2.3's memory
usage (the defaults are extremely sad for most cases).

9) Shut down PostgreSQL

10) Edit the postgresql.conf file in the database storage area.  Bruce
Momjian's guide gives a good overview of the parameters needed to
change:

http://www.ca.postgresql.org/docs/momjian/hw_performance/

11) Start PostgreSQL again.

From here on, all should be fine.

Well, this is the overview of the process, but hopefully it gives you'll
be able to figure out the exact commands needed for each one, etc.

And just to re-inforce the point... please backup your data before doing
this.

:-)

Regards and best wishes,

Justin Clift


"Aurangzeb M. Agha" wrote:
>
> I'm having a horrible time trying to upgrade from 7.1.3 on our Linux RH
> 7.2 box to the latest version.
>
> I first tried "up2date", which failed as it didn't even know there was ANY
> update available for Postgres.
>
> I then downloaded the new TAR for 7.2.3 and walked through the upgrade
> steps in pg_upgrade.1, only to be brought to a screaching halt in step 2
> of the upgrade:
>
>         $ pg_upgrade -2
>         pg_upgrade is for PostgreSQL version 7.2
>         but /usr/local/G101/CMS/App/DB/PG_VERSION contains 7.1.
>         Did you run initdb for version 7.1 by mistake?
>
> When I found the NEW PgSQL bin, I re-ran initdb.  However, running
> 'pg_upgrade -2' gave me:
>
>         Unable to find pg_resetxlog in your path.
>         Install it from pgsql/contrib/pg_resetxlog and continue.  Exiting.
>
> I put pgsql/contrib/pg_resetxlog in the new PgSQL bin
> (/usr/local/pgsql/bin) but when I try to run pg_upgrade -2, I get:
>
>         Locales do not match between the two versions.  Exiting.
>
> What does that mean?  What do I do to get around it?
>
> The (old) RPM's I have on my system are:
>
>         $ rpm -qa | grep -i postgres
>         postgresql-contrib-7.1.3-2
>         postgresql-tk-7.1.3-2
>         postgresql-libs-7.1.3-2
>         postgresql-server-7.1.3-2
>         postgresql-docs-7.1.3-2
>         postgresql-tcl-7.1.3-2
>         postgresql-7.1.3-2
>         postgresql-jdbc-7.1.3-2
>
> I'm ready to do the upgrade anyway possible, using pg_upgrade, not using
> it, whatever.
>
> If I do a new install, do I need to remove all the RPM installation I
> already have on my machine?  What about everything that got installed
> during the upgrade process?
>
> Any help would be appreciated.
>
>         Thanks in Advance,
>         Aurangzeb
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi

Re: Upgrading from 7.1.3 to 7.2.3

From
"Aurangzeb M. Agha"
Date:
Neil and Justin --

Thanks for both of your suggestions.  I've done as you guys have suggested
and completed the migration to 7.2.3.  Thanks a lot!

BTW, the first thing I did was make two copies of DB/data.

    Thx Again,
    Aurangzeb

On Mon, 11 Nov 2002, Justin Clift wrote:

:Hi Aurangzeb,
:
:First and *most important question*... have you backed up your data?  Do
:so *first*.  :)
:
:>From everything you've said here, the safest approach will probably be
:to extract all of your data with the 'pg_dumpall' command, get 7.2.3
:installed, then reload your data.
:
:If this sounds alright to you, then try this:
:
:1) Make sure that your old version of PostgreSQL is running
:
:2) Extract/dump your data to a file
:
:$ pg_dumpall > somefile
:
:3) Uninstall your old version of PostgreSQL (version 7.1.3 in your case)
:
:4) Delete the old database storage files, you don't need them any more
:
:5) Install the new version of PostgreSQL (version 7.2.3 in this case)
:
:6) Initialise a new database storage area:
:
:$ PGDATA=/some/empty/directory/location
:$ export PGDATA
:$ initdb
:
:7) Start the new version of PostgreSQL to check it works.  It should
:startup fine.
:
:8) Load your data base into the database
:
:$ psql template1 < somefile
:
:If that all worked, you should now configure PostgreSQL 7.2.3's memory
:usage (the defaults are extremely sad for most cases).
:
:9) Shut down PostgreSQL
:
:10) Edit the postgresql.conf file in the database storage area.  Bruce
:Momjian's guide gives a good overview of the parameters needed to
:change:
:
:http://www.ca.postgresql.org/docs/momjian/hw_performance/
:
:11) Start PostgreSQL again.
:
:>From here on, all should be fine.
:
:Well, this is the overview of the process, but hopefully it gives you'll
:be able to figure out the exact commands needed for each one, etc.
:
:And just to re-inforce the point... please backup your data before doing
:this.
:
::-)
:
:Regards and best wishes,
:
:Justin Clift
:
:
:"Aurangzeb M. Agha" wrote:
:>
:> I'm having a horrible time trying to upgrade from 7.1.3 on our Linux RH
:> 7.2 box to the latest version.
:>
:> I first tried "up2date", which failed as it didn't even know there was ANY
:> update available for Postgres.
:>
:> I then downloaded the new TAR for 7.2.3 and walked through the upgrade
:> steps in pg_upgrade.1, only to be brought to a screaching halt in step 2
:> of the upgrade:
:>
:>         $ pg_upgrade -2
:>         pg_upgrade is for PostgreSQL version 7.2
:>         but /usr/local/G101/CMS/App/DB/PG_VERSION contains 7.1.
:>         Did you run initdb for version 7.1 by mistake?
:>
:> When I found the NEW PgSQL bin, I re-ran initdb.  However, running
:> 'pg_upgrade -2' gave me:
:>
:>         Unable to find pg_resetxlog in your path.
:>         Install it from pgsql/contrib/pg_resetxlog and continue.  Exiting.
:>
:> I put pgsql/contrib/pg_resetxlog in the new PgSQL bin
:> (/usr/local/pgsql/bin) but when I try to run pg_upgrade -2, I get:
:>
:>         Locales do not match between the two versions.  Exiting.
:>
:> What does that mean?  What do I do to get around it?
:>
:> The (old) RPM's I have on my system are:
:>
:>         $ rpm -qa | grep -i postgres
:>         postgresql-contrib-7.1.3-2
:>         postgresql-tk-7.1.3-2
:>         postgresql-libs-7.1.3-2
:>         postgresql-server-7.1.3-2
:>         postgresql-docs-7.1.3-2
:>         postgresql-tcl-7.1.3-2
:>         postgresql-7.1.3-2
:>         postgresql-jdbc-7.1.3-2
:>
:> I'm ready to do the upgrade anyway possible, using pg_upgrade, not using
:> it, whatever.
:>
:> If I do a new install, do I need to remove all the RPM installation I
:> already have on my machine?  What about everything that got installed
:> during the upgrade process?
:>
:> Any help would be appreciated.
:>
:>         Thanks in Advance,
:>         Aurangzeb
:>
:> ---------------------------(end of broadcast)---------------------------
:> TIP 6: Have you searched our list archives?
:>
:> http://archives.postgresql.org
:
:

--
Aurangzeb M. Agha    | Email : aagha@bigfoot.com
                     | Home  : +3 010 8959.558
34 Nafsika St.       | Direct: +3 010 8995.875
Voula 16673          | Mobile: TBD
Greece               | Voice : 415 412 4234 (US Only)
                     | e-Fax : 978 246.0770
PGP ID: 0x68B3A763   |

"Those who would give up essential liberty to purchase a little
 temporary safety deserve neither liberty nor safety."

                    - Benjamin Franklin



Re: Upgrading from 7.1.3 to 7.2.3

From
Andrew Sullivan
Date:
On Sun, Nov 10, 2002 at 02:59:58PM -0800, Aurangzeb M. Agha wrote:
>
> BTW, the first thing I did was make two copies of DB/data.

While you were shut down, right?  Because if not, your copies may be
useless.



>
>     Thx Again,
>     Aurangzeb
>
> On Mon, 11 Nov 2002, Justin Clift wrote:
>
> :Hi Aurangzeb,
> :
> :First and *most important question*... have you backed up your data?  Do
> :so *first*.  :)
> :
> :>From everything you've said here, the safest approach will probably be
> :to extract all of your data with the 'pg_dumpall' command, get 7.2.3
> :installed, then reload your data.
> :
> :If this sounds alright to you, then try this:
> :
> :1) Make sure that your old version of PostgreSQL is running
> :
> :2) Extract/dump your data to a file
> :
> :$ pg_dumpall > somefile
> :
> :3) Uninstall your old version of PostgreSQL (version 7.1.3 in your case)
> :
> :4) Delete the old database storage files, you don't need them any more
> :
> :5) Install the new version of PostgreSQL (version 7.2.3 in this case)
> :
> :6) Initialise a new database storage area:
> :
> :$ PGDATA=/some/empty/directory/location
> :$ export PGDATA
> :$ initdb
> :
> :7) Start the new version of PostgreSQL to check it works.  It should
> :startup fine.
> :
> :8) Load your data base into the database
> :
> :$ psql template1 < somefile
> :
> :If that all worked, you should now configure PostgreSQL 7.2.3's memory
> :usage (the defaults are extremely sad for most cases).
> :
> :9) Shut down PostgreSQL
> :
> :10) Edit the postgresql.conf file in the database storage area.  Bruce
> :Momjian's guide gives a good overview of the parameters needed to
> :change:
> :
> :http://www.ca.postgresql.org/docs/momjian/hw_performance/
> :
> :11) Start PostgreSQL again.
> :
> :>From here on, all should be fine.
> :
> :Well, this is the overview of the process, but hopefully it gives you'll
> :be able to figure out the exact commands needed for each one, etc.
> :
> :And just to re-inforce the point... please backup your data before doing
> :this.
> :
> ::-)
> :
> :Regards and best wishes,
> :
> :Justin Clift
> :
> :
> :"Aurangzeb M. Agha" wrote:
> :>
> :> I'm having a horrible time trying to upgrade from 7.1.3 on our Linux RH
> :> 7.2 box to the latest version.
> :>
> :> I first tried "up2date", which failed as it didn't even know there was ANY
> :> update available for Postgres.
> :>
> :> I then downloaded the new TAR for 7.2.3 and walked through the upgrade
> :> steps in pg_upgrade.1, only to be brought to a screaching halt in step 2
> :> of the upgrade:
> :>
> :>         $ pg_upgrade -2
> :>         pg_upgrade is for PostgreSQL version 7.2
> :>         but /usr/local/G101/CMS/App/DB/PG_VERSION contains 7.1.
> :>         Did you run initdb for version 7.1 by mistake?
> :>
> :> When I found the NEW PgSQL bin, I re-ran initdb.  However, running
> :> 'pg_upgrade -2' gave me:
> :>
> :>         Unable to find pg_resetxlog in your path.
> :>         Install it from pgsql/contrib/pg_resetxlog and continue.  Exiting.
> :>
> :> I put pgsql/contrib/pg_resetxlog in the new PgSQL bin
> :> (/usr/local/pgsql/bin) but when I try to run pg_upgrade -2, I get:
> :>
> :>         Locales do not match between the two versions.  Exiting.
> :>
> :> What does that mean?  What do I do to get around it?
> :>
> :> The (old) RPM's I have on my system are:
> :>
> :>         $ rpm -qa | grep -i postgres
> :>         postgresql-contrib-7.1.3-2
> :>         postgresql-tk-7.1.3-2
> :>         postgresql-libs-7.1.3-2
> :>         postgresql-server-7.1.3-2
> :>         postgresql-docs-7.1.3-2
> :>         postgresql-tcl-7.1.3-2
> :>         postgresql-7.1.3-2
> :>         postgresql-jdbc-7.1.3-2
> :>
> :> I'm ready to do the upgrade anyway possible, using pg_upgrade, not using
> :> it, whatever.
> :>
> :> If I do a new install, do I need to remove all the RPM installation I
> :> already have on my machine?  What about everything that got installed
> :> during the upgrade process?
> :>
> :> Any help would be appreciated.
> :>
> :>         Thanks in Advance,
> :>         Aurangzeb
> :>
> :> ---------------------------(end of broadcast)---------------------------
> :> TIP 6: Have you searched our list archives?
> :>
> :> http://archives.postgresql.org
> :
> :
>
> --
> Aurangzeb M. Agha    | Email : aagha@bigfoot.com
>                      | Home  : +3 010 8959.558
> 34 Nafsika St.       | Direct: +3 010 8995.875
> Voula 16673          | Mobile: TBD
> Greece               | Voice : 415 412 4234 (US Only)
>                      | e-Fax : 978 246.0770
> PGP ID: 0x68B3A763   |
>
> "Those who would give up essential liberty to purchase a little
>  temporary safety deserve neither liberty nor safety."
>
>                     - Benjamin Franklin
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


Re: Upgrading from 7.1.3 to 7.2.3

From
"scott.marlowe"
Date:
I ALWAYS do the first migration onto a test box first.  I.e. I pg_dumpall
on the old machine, ftp the file into the test server with a fresh build
of the new postgresql and do a pg_restore on that box to make sure the
upgrade will work.

It's not uncommon for things like sequences, rules, triggers, user defined
functions etc... to have some issues with an upgrade.

I've often found that using the pg_dump from the newer version of
postgresql against the older server is an answer to a lot of these
problems, and if I remember correctly, that was the fix for a few upgrade
issues when going to 7.2.x.

On Tue, 12 Nov 2002, Andrew Sullivan wrote:

> On Sun, Nov 10, 2002 at 02:59:58PM -0800, Aurangzeb M. Agha wrote:
> >
> > BTW, the first thing I did was make two copies of DB/data.
>
> While you were shut down, right?  Because if not, your copies may be
> useless.