X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B923DD1B432 for ; Wed, 10 Dec 2003 06:38:32 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 92902-04 for ; Wed, 10 Dec 2003 02:38:01 -0400 (AST) Received: from ndl1mr1-a-fixed.sancharnet.in (ndl1mr1-a-fixed.sancharnet.in [61.0.0.45]) by svr1.postgresql.org (Postfix) with ESMTP id 2C5F2D1B48F for ; Wed, 10 Dec 2003 02:37:55 -0400 (AST) Received: from conversion-daemon.ndl1mr1-a-fixed.sancharnet.in by ndl1mr1-a-fixed.sancharnet.in (iPlanet Messaging Server 5.2 HotFix 1.17 (built Jun 23 2003)) id <0HPO007011UI8S@ndl1mr1-a-fixed.sancharnet.in> for pgsql-admin@postgresql.org; Wed, 10 Dec 2003 12:00:26 +0530 (IST) Received: from proxyplus.universe ([61.0.95.118]) by ndl1mr1-a-fixed.sancharnet.in (iPlanet Messaging Server 5.2 HotFix 1.17 (built Jun 23 2003)) with ESMTPA id <0HPO00AHL21O15@ndl1mr1-a-fixed.sancharnet.in>; Wed, 10 Dec 2003 12:00:26 +0530 (IST) Received: from sancharnet.in [192.50.200.20] by Proxy+; Wed, 10 Dec 2003 12:02:02 +0530 Date: Wed, 10 Dec 2003 12:02:01 +0530 From: Sai Hertz And Control Systems Subject: Re: Upgrading from 7.2.4 (RH 8) to 7.4 (RH9) In-reply-to: <203C7FC3FF2D7A4588CE0429A87F3C9A04DE03@vt-pe2550-001.vantage.vantage.com> To: Anjan Dave Cc: Postgres Admin List Message-id: <3FD6BDE1.7000802@sancharnet.in> MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_bGk0IUSmwECHzH6FGEnc5w)" X-Accept-Language: en-us, en X-Priority: 1 (highest) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 References: <203C7FC3FF2D7A4588CE0429A87F3C9A04DE03@vt-pe2550-001.vantage.vantage.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=BAYES_10, FROM_ENDS_IN_NUMS, HTML_20_30, IN_REP_TO, PRIORITY_NO_NAME, QUOTED_EMAIL_TEXT, RCVD_IN_RFCI, REFERENCES, REPLY_WITH_QUOTES, USER_AGENT_MOZILLA_UA, X_PRIORITY_HIGH X-Spam-Level: X-Archive-Number: 200312/131 X-Sequence-Number: 11639 This is a multi-part message in MIME format. --Boundary_(ID_bGk0IUSmwECHzH6FGEnc5w) Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT Dear Anjan Dave , > I would like to start planning on upgrading a few servers from RH8 to > RH9, essentially, also upgrading Postgres from 7.3.2 to 7.4 from the OS. > > There's also a box with RH7.3 (postgres 7.2.1) that could be upgraded > to RH9 and Postgres 7.4. > > I am not sure if I should backup (pg_dump) the databases, and do a > clean install of the OS, and do a pg_restore...OR, just upgrade the OS..? > This is what I do when migrating . 1. Take a file system backup of PostgreSQL "data" folder preferably with DUMP 2. Take a back up of data with pg_dump --disable-triggers -U -a -d -b -D -Fc -Z 9 -f filename.tar.gz a. This will take care of blobs (Though 7.2 does not have it) b. Make sure that your data be less than 8 GB as tar could not handle more than that 3. Yes Schema is also required to be backed up with above command and having switch as pg_dump --disable-triggers -U -s Fp -f schema.sql 4. Now why Schema is dumped separately to that of data Because : a. pg_dump will dump the schema as per its own wish and not as per the database requirement so if a required user defined function is not in the secema dump as early as it is required your pg_restore will abort with Xmas bells b. In this case you can rearrange the creation of Schema as Create functions > then table > then sequences > then views 5. Now after all stuff you have done install your new OS initdb a new database in the same directory location as it was in the old one (i.e in the older OS) 6. Now try restore the Schema if succeeds then go to 7 else rearrange your sql statements to satisfy the monster 7. Restore Data with pg_restore --disable-triggers -U -d ./filename.tar.gz 8. Now if 6 and 7 fails you have a chance reinstall the older version of postgresql and also its DUMP file to regain the data and schema again and start again from point 2 to 8 This is what I do to restore / migrate and have got 100 % results till date Any one having a better and more reliable method please pass it on to Anjan Dave and me We would be grateful to you Regrads, V Kashyap --Boundary_(ID_bGk0IUSmwECHzH6FGEnc5w) Content-type: text/html; charset=us-ascii Content-transfer-encoding: 7BIT Dear Anjan Dave ,
Upgrading from 7.2.4 (RH 8) to 7.4 (RH9)

I would like to start planning on upgrading a few servers from RH8 to RH9, essentially, also upgrading Postgres from 7.3.2 to 7.4 from the OS.

There's also a box with RH7.3 (postgres 7.2.1) that could be upgraded to RH9 and Postgres 7.4.

I am not sure if I should backup (pg_dump) the databases, and do a clean install of the OS, and do a pg_restore…OR, just upgrade the OS..?

This is what I do when migrating .
1. Take a file system backup of  PostgreSQL "data"   folder  preferably with DUMP
2.  Take a back up of   data  with
        pg_dump --disable-triggers -U <USER NAME>  -a -d -b -D -Fc -Z 9  -f    filename.tar.gz   <DATABASE NAME>
       a. This will take care of blobs (Though 7.2 does not have it)
       b. Make sure that your data be less than 8 GB as tar could not handle  more than that
3.  Yes Schema is also required to be backed up with above command and having switch as

        pg_dump --disable-triggers -U <USER NAME>  -s Fp  -f    schema.sql   <DATABASE NAME>
4. Now why Schema is dumped separately to that of  data
    Because :
    a. pg_dump will dump the schema as per its own wish and not as per the  database requirement so
       if a required user defined function is not  in the secema dump as early as it is required  your pg_restore will
       abort with Xmas bells
    b. In this case you can rearrange the creation of  Schema as
          Create functions > then table >  then sequences > then views
5.  Now after all stuff you have done install your new OS
    initdb  a new database in the same directory location as it was in the old one (i.e in the older OS)
6. Now try restore the Schema  if succeeds  then go to 7 else
    rearrange your sql statements to satisfy the monster
7. Restore Data with
    pg_restore  --disable-triggers -U <USER NAME>  -d   <DATABASE NAME>  ./filename.tar.gz
8. Now if 6 and  7 fails you have a chance reinstall the older version of postgresql and also its DUMP file to regain the data and schema again and start again from point 2 to 8
  
This is what I do  to restore / migrate and have got 100 % results till date

Any one having a better and more reliable method please pass it on to  Anjan Dave and me

We would be grateful to you

Regrads,
V Kashyap


--Boundary_(ID_bGk0IUSmwECHzH6FGEnc5w)--