pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Upgrading from 9.1 to 9.2 in place, same machine
15+ messages / 6 participants
[nested] [flat]

* Upgrading from 9.1 to 9.2 in place, same machine
@ 2013-07-10 17:53 Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:10 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Chris Ernst <cernst@zvelo.com>
  0 siblings, 2 replies; 15+ messages in thread

From: Wells Oliver @ 2013-07-10 17:53 UTC (permalink / raw)
  To: pgsql-admin

I have 9.1 running on 5432, and 9.2 running on 5433. The 9.1 database size
is 153g. 9.1 is actively used by systems, 9.2 is just sitting there empty.

I'd like to move the 9.1 database to 9.2 without any down time, and
ensuring that no data is lost.

My original idea was to make 9.2 a slave of 9.1, then switch it over.

Is there a better idea? Thanks for any tips.

-- 
Wells Oliver
wellsoliver@gmail.com

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
@ 2013-07-10 18:08 ` Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:16   ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  1 sibling, 2 replies; 15+ messages in thread

From: Jonathan Nalley @ 2013-07-10 18:08 UTC (permalink / raw)
  To: pgsql-admin

On Wed, Jul 10, 2013 at 1:53 PM, Wells Oliver <wellsoliver@gmail.com> wrote:
> I have 9.1 running on 5432, and 9.2 running on 5433. The 9.1 database size
> is 153g. 9.1 is actively used by systems, 9.2 is just sitting there empty.
>
> I'd like to move the 9.1 database to 9.2 without any down time, and ensuring
> that no data is lost.
>
> My original idea was to make 9.2 a slave of 9.1, then switch it over.
>
> Is there a better idea? Thanks for any tips.

have you looked at simply using pg_upgrade ?

http://www.postgresql.org/docs/9.2/static/pgupgrade.html


>
> --
> Wells Oliver
> wellsoliver@gmail.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] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
@ 2013-07-10 18:16   ` ktm@rice.edu <ktm@rice.edu>
  1 sibling, 0 replies; 15+ messages in thread

From: ktm@rice.edu @ 2013-07-10 18:16 UTC (permalink / raw)
  To: Jonathan Nalley <jnalley@jnalley.com>; +Cc: pgsql-admin

On Wed, Jul 10, 2013 at 02:08:04PM -0400, Jonathan Nalley wrote:
> On Wed, Jul 10, 2013 at 1:53 PM, Wells Oliver <wellsoliver@gmail.com> wrote:
> > I have 9.1 running on 5432, and 9.2 running on 5433. The 9.1 database size
> > is 153g. 9.1 is actively used by systems, 9.2 is just sitting there empty.
> >
> > I'd like to move the 9.1 database to 9.2 without any down time, and ensuring
> > that no data is lost.
> >
> > My original idea was to make 9.2 a slave of 9.1, then switch it over.
> >
> > Is there a better idea? Thanks for any tips.
> 
> have you looked at simply using pg_upgrade ?
> 
> http://www.postgresql.org/docs/9.2/static/pgupgrade.html
> 

Hi Wells,

I would definitely consider pgupgrade. You could test it first to get
some timings. I would make a 9.1 slave on the same box and run pg_upgrade
against it. Then if you have a problem you can restart using the original.
You can also use something like slony or bucardo to replicate from 9.1 to
9.2 and then failover to it that way.

Regards,
Ken


-- 
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] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
@ 2013-07-10 18:52   ` Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:03     ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
  1 sibling, 2 replies; 15+ messages in thread

From: Wells Oliver @ 2013-07-10 18:52 UTC (permalink / raw)
  To: pgsql-admin

Can anyone speak to the speed of pg_upgrade? Our database is 153GB. From
9.1 to 9.2, I'm nervous it might take hours. If it were less than hour,
downtime would be more acceptable.


On Wed, Jul 10, 2013 at 11:08 AM, Jonathan Nalley <jnalley@jnalley.com>wrote:

> On Wed, Jul 10, 2013 at 1:53 PM, Wells Oliver <wellsoliver@gmail.com>
> wrote:
> > I have 9.1 running on 5432, and 9.2 running on 5433. The 9.1 database
> size
> > is 153g. 9.1 is actively used by systems, 9.2 is just sitting there
> empty.
> >
> > I'd like to move the 9.1 database to 9.2 without any down time, and
> ensuring
> > that no data is lost.
> >
> > My original idea was to make 9.2 a slave of 9.1, then switch it over.
> >
> > Is there a better idea? Thanks for any tips.
>
> have you looked at simply using pg_upgrade ?
>
> http://www.postgresql.org/docs/9.2/static/pgupgrade.html
>
>
> >
> > --
> > Wells Oliver
> > wellsoliver@gmail.com
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>



-- 
Wells Oliver
wellsoliver@gmail.com

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
@ 2013-07-10 18:59     ` Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:02       ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Vincent Lau @ 2013-07-10 18:59 UTC (permalink / raw)
  To: Wells Oliver <wellsoliver@gmail.com>; +Cc: pgsql-admin

We did an in-place upgrade(with the -k option) against a 6Tb DB from 8.4 to
9.2. It took all of 10 minutes to complete, which didn't count for running
the analyze afterward. However, if you are going to run the analyze DB
afterward, your mileage may vary.


On Wed, Jul 10, 2013 at 11:52 AM, Wells Oliver <wellsoliver@gmail.com>wrote:

> Can anyone speak to the speed of pg_upgrade? Our database is 153GB. From
> 9.1 to 9.2, I'm nervous it might take hours. If it were less than hour,
> downtime would be more acceptable.
>
>
> On Wed, Jul 10, 2013 at 11:08 AM, Jonathan Nalley <jnalley@jnalley.com>wrote:
>
>> On Wed, Jul 10, 2013 at 1:53 PM, Wells Oliver <wellsoliver@gmail.com>
>> wrote:
>> > I have 9.1 running on 5432, and 9.2 running on 5433. The 9.1 database
>> size
>> > is 153g. 9.1 is actively used by systems, 9.2 is just sitting there
>> empty.
>> >
>> > I'd like to move the 9.1 database to 9.2 without any down time, and
>> ensuring
>> > that no data is lost.
>> >
>> > My original idea was to make 9.2 a slave of 9.1, then switch it over.
>> >
>> > Is there a better idea? Thanks for any tips.
>>
>> have you looked at simply using pg_upgrade ?
>>
>> http://www.postgresql.org/docs/9.2/static/pgupgrade.html
>>
>>
>> >
>> > --
>> > Wells Oliver
>> > wellsoliver@gmail.com
>>
>>
>> --
>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-admin
>>
>
>
>
> --
> Wells Oliver
> wellsoliver@gmail.com
>



-- 
Vincent Lau | Database Administrator
503.284.7581 x394 | vincent.lau@rentrak.com <vincent.lau@rentrakmail.com>
RENTRAK | www.rentrak.com | NASDAQ: RENT

Notice: This message is confidential and is intended only for the
recipient(s) named above. If you have received this message in error,
or are not the named recipient(s), please immediately notify the
sender and delete this message.

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
@ 2013-07-10 19:02       ` Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:12         ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:13         ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
  0 siblings, 2 replies; 15+ messages in thread

From: Wells Oliver @ 2013-07-10 19:02 UTC (permalink / raw)
  To: pgsql-admin

Hard linking means that you must maintain 8.2's data directory though, even
after upgrade, correct? Since it's a link and not a copied file.


On Wed, Jul 10, 2013 at 11:59 AM, Vincent Lau
<vincent.lau@rentrakmail.com>wrote:

> We did an in-place upgrade(with the -k option) against a 6Tb DB from 8.4
> to 9.2. It took all of 10 minutes to complete, which didn't count for
> running the analyze afterward. However, if you are going to run the analyze
> DB afterward, your mileage may vary.
>
>
> On Wed, Jul 10, 2013 at 11:52 AM, Wells Oliver <wellsoliver@gmail.com>wrote:
>
>> Can anyone speak to the speed of pg_upgrade? Our database is 153GB. From
>> 9.1 to 9.2, I'm nervous it might take hours. If it were less than hour,
>> downtime would be more acceptable.
>>
>>
>> On Wed, Jul 10, 2013 at 11:08 AM, Jonathan Nalley <jnalley@jnalley.com>wrote:
>>
>>> On Wed, Jul 10, 2013 at 1:53 PM, Wells Oliver <wellsoliver@gmail.com>
>>> wrote:
>>> > I have 9.1 running on 5432, and 9.2 running on 5433. The 9.1 database
>>> size
>>> > is 153g. 9.1 is actively used by systems, 9.2 is just sitting there
>>> empty.
>>> >
>>> > I'd like to move the 9.1 database to 9.2 without any down time, and
>>> ensuring
>>> > that no data is lost.
>>> >
>>> > My original idea was to make 9.2 a slave of 9.1, then switch it over.
>>> >
>>> > Is there a better idea? Thanks for any tips.
>>>
>>> have you looked at simply using pg_upgrade ?
>>>
>>> http://www.postgresql.org/docs/9.2/static/pgupgrade.html
>>>
>>>
>>> >
>>> > --
>>> > Wells Oliver
>>> > wellsoliver@gmail.com
>>>
>>>
>>> --
>>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-admin
>>>
>>
>>
>>
>> --
>> Wells Oliver
>> wellsoliver@gmail.com
>>
>
>
>
> --
> Vincent Lau | Database Administrator
> 503.284.7581 x394 | vincent.lau@rentrak.com <vincent.lau@rentrakmail.com>
> RENTRAK | www.rentrak.com | NASDAQ: RENT
>
> Notice: This message is confidential and is intended only for the
> recipient(s) named above. If you have received this message in error,
> or are not the named recipient(s), please immediately notify the
> sender and delete this message.
>



-- 
Wells Oliver
wellsoliver@gmail.com

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:02       ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
@ 2013-07-10 19:12         ` Vincent Lau <vincent.lau@rentrakmail.com>
  1 sibling, 0 replies; 15+ messages in thread

From: Vincent Lau @ 2013-07-10 19:12 UTC (permalink / raw)
  To: Wells Oliver <wellsoliver@gmail.com>; +Cc: pgsql-admin

The -k or --link option makes hard links. Therefore, after the upgrade you
can safely wipe out the entire old 9.1 data directory. I removed the 8.4
data directory without affecting the 9.2 data. After pg_upgrade is
finished, it even generates a shell script called "delete_old_cluster.sh"
so you can run it to remove the old data directory along with some 9.2 temp
tablespace files.


On Wed, Jul 10, 2013 at 12:02 PM, Wells Oliver <wellsoliver@gmail.com>wrote:

> Hard linking means that you must maintain 8.2's data directory though,
> even after upgrade, correct? Since it's a link and not a copied file.
>
>
> On Wed, Jul 10, 2013 at 11:59 AM, Vincent Lau <vincent.lau@rentrakmail.com
> > wrote:
>
>> We did an in-place upgrade(with the -k option) against a 6Tb DB from 8.4
>> to 9.2. It took all of 10 minutes to complete, which didn't count for
>> running the analyze afterward. However, if you are going to run the analyze
>> DB afterward, your mileage may vary.
>>
>>
>> On Wed, Jul 10, 2013 at 11:52 AM, Wells Oliver <wellsoliver@gmail.com>wrote:
>>
>>> Can anyone speak to the speed of pg_upgrade? Our database is 153GB. From
>>> 9.1 to 9.2, I'm nervous it might take hours. If it were less than hour,
>>> downtime would be more acceptable.
>>>
>>>
>>> On Wed, Jul 10, 2013 at 11:08 AM, Jonathan Nalley <jnalley@jnalley.com>wrote:
>>>
>>>> On Wed, Jul 10, 2013 at 1:53 PM, Wells Oliver <wellsoliver@gmail.com>
>>>> wrote:
>>>> > I have 9.1 running on 5432, and 9.2 running on 5433. The 9.1 database
>>>> size
>>>> > is 153g. 9.1 is actively used by systems, 9.2 is just sitting there
>>>> empty.
>>>> >
>>>> > I'd like to move the 9.1 database to 9.2 without any down time, and
>>>> ensuring
>>>> > that no data is lost.
>>>> >
>>>> > My original idea was to make 9.2 a slave of 9.1, then switch it over.
>>>> >
>>>> > Is there a better idea? Thanks for any tips.
>>>>
>>>> have you looked at simply using pg_upgrade ?
>>>>
>>>> http://www.postgresql.org/docs/9.2/static/pgupgrade.html
>>>>
>>>>
>>>> >
>>>> > --
>>>> > Wells Oliver
>>>> > wellsoliver@gmail.com
>>>>
>>>>
>>>> --
>>>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgsql-admin
>>>>
>>>
>>>
>>>
>>> --
>>> Wells Oliver
>>> wellsoliver@gmail.com
>>>
>>
>>
>>
>> --
>> Vincent Lau | Database Administrator
>> 503.284.7581 x394 | vincent.lau@rentrak.com <vincent.lau@rentrakmail.com>
>> RENTRAK | www.rentrak.com | NASDAQ: RENT
>>
>> Notice: This message is confidential and is intended only for the
>> recipient(s) named above. If you have received this message in error,
>> or are not the named recipient(s), please immediately notify the
>> sender and delete this message.
>>
>
>
>
> --
> Wells Oliver
> wellsoliver@gmail.com
>



-- 
Vincent Lau | Database Administrator
503.284.7581 x394 | vincent.lau@rentrak.com <vincent.lau@rentrakmail.com>
RENTRAK | www.rentrak.com | NASDAQ: RENT

Notice: This message is confidential and is intended only for the
recipient(s) named above. If you have received this message in error,
or are not the named recipient(s), please immediately notify the
sender and delete this message.

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:02       ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
@ 2013-07-10 19:13         ` ktm@rice.edu <ktm@rice.edu>
  2013-07-10 19:19           ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: ktm@rice.edu @ 2013-07-10 19:13 UTC (permalink / raw)
  To: Wells Oliver <wellsoliver@gmail.com>; +Cc: pgsql-admin

On Wed, Jul 10, 2013 at 12:02:06PM -0700, Wells Oliver wrote:
> Hard linking means that you must maintain 8.2's data directory though, even
> after upgrade, correct? Since it's a link and not a copied file.
> 
I think it only hard links the files to the new 9.2 data directory so you
can delete the old data directory and the files will still be in the new
directory since the link count will be > 0.

Ken


-- 
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] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:02       ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:13         ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
@ 2013-07-10 19:19           ` Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:24             ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Wells Oliver @ 2013-07-10 19:19 UTC (permalink / raw)
  To: pgsql-admin

OK, cool. I did not want to be in a position where I stop the servers,
pg_upgrade --link 9.1 to 9.2, then (eventually) pg_dropcluster of 9.1 and,
woops, I killed all of my data files.


On Wed, Jul 10, 2013 at 12:13 PM, ktm@rice.edu <ktm@rice.edu> wrote:

> On Wed, Jul 10, 2013 at 12:02:06PM -0700, Wells Oliver wrote:
> > Hard linking means that you must maintain 8.2's data directory though,
> even
> > after upgrade, correct? Since it's a link and not a copied file.
> >
> I think it only hard links the files to the new 9.2 data directory so you
> can delete the old data directory and the files will still be in the new
> directory since the link count will be > 0.
>
> Ken
>



-- 
Wells Oliver
wellsoliver@gmail.com

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:02       ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:13         ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
  2013-07-10 19:19           ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
@ 2013-07-10 19:24             ` Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 20:46               ` Re: Upgrading from 9.1 to 9.2 in place, same machine lxnf98mm@gmail.com
  0 siblings, 1 reply; 15+ messages in thread

From: Vincent Lau @ 2013-07-10 19:24 UTC (permalink / raw)
  To: Wells Oliver <wellsoliver@gmail.com>; +Cc: pgsql-admin

On Wed, Jul 10, 2013 at 12:19 PM, Wells Oliver <wellsoliver@gmail.com>wrote:

> OK, cool. I did not want to be in a position where I stop the servers,
> pg_upgrade --link 9.1 to 9.2, then (eventually) pg_dropcluster of 9.1 and,
> woops, I killed all of my data files.
>
>
And if you have enough storage, you can always stage a testing environment
and test this out. It'd tell you how long the whole upgrade would take too.
:)



>
> On Wed, Jul 10, 2013 at 12:13 PM, ktm@rice.edu <ktm@rice.edu> wrote:
>
>> On Wed, Jul 10, 2013 at 12:02:06PM -0700, Wells Oliver wrote:
>> > Hard linking means that you must maintain 8.2's data directory though,
>> even
>> > after upgrade, correct? Since it's a link and not a copied file.
>> >
>> I think it only hard links the files to the new 9.2 data directory so you
>> can delete the old data directory and the files will still be in the new
>> directory since the link count will be > 0.
>>
>> Ken
>>
>
>
>
> --
> Wells Oliver
> wellsoliver@gmail.com
>



-- 
Vincent Lau | Database Administrator
503.284.7581 x394 | vincent.lau@rentrak.com <vincent.lau@rentrakmail.com>
RENTRAK | www.rentrak.com | NASDAQ: RENT

Notice: This message is confidential and is intended only for the
recipient(s) named above. If you have received this message in error,
or are not the named recipient(s), please immediately notify the
sender and delete this message.

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:02       ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:13         ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
  2013-07-10 19:19           ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:24             ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
@ 2013-07-10 20:46               ` lxnf98mm@gmail.com
  2013-07-10 21:02                 ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
  0 siblings, 1 reply; 15+ messages in thread

From: lxnf98mm@gmail.com @ 2013-07-10 20:46 UTC (permalink / raw)
  To: pgsql-admin

On Wed, 10 Jul 2013, Vincent Lau wrote:

> On Wed, Jul 10, 2013 at 12:19 PM, Wells Oliver <wellsoliver@gmail.com>wrote:
>
>> OK, cool. I did not want to be in a position where I stop the servers,
>> pg_upgrade --link 9.1 to 9.2, then (eventually) pg_dropcluster of 9.1 and,
>> woops, I killed all of my data files.
>>
>>
> And if you have enough storage, you can always stage a testing environment
> and test this out. It'd tell you how long the whole upgrade would take too.
> :)
>
>
>
>>
>> On Wed, Jul 10, 2013 at 12:13 PM, ktm@rice.edu <ktm@rice.edu> wrote:
>>
>>> On Wed, Jul 10, 2013 at 12:02:06PM -0700, Wells Oliver wrote:
>>>> Hard linking means that you must maintain 8.2's data directory though,
>>> even
>>>> after upgrade, correct? Since it's a link and not a copied file.
>>>>
>>> I think it only hard links the files to the new 9.2 data directory so you
>>> can delete the old data directory and the files will still be in the new
>>> directory since the link count will be > 0.
>>>
>>> Ken
>>>
>>
>>
>>
>> --
>> Wells Oliver
>> wellsoliver@gmail.com
>>
>
>
>
> -- 
> Vincent Lau | Database Administrator
> 503.284.7581 x394 | vincent.lau@rentrak.com <vincent.lau@rentrakmail.com>
> RENTRAK | www.rentrak.com | NASDAQ: RENT
>
> Notice: This message is confidential and is intended only for the
> recipient(s) named above. If you have received this message in error,
> or are not the named recipient(s), please immediately notify the
> sender and delete this message.
>


how would pg_upgrade be used to upgrade to a new machine
use nfs?
would i run pg_upgrade on the new server?


-- 
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] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:02       ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:13         ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
  2013-07-10 19:19           ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:24             ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 20:46               ` Re: Upgrading from 9.1 to 9.2 in place, same machine lxnf98mm@gmail.com
@ 2013-07-10 21:02                 ` ktm@rice.edu <ktm@rice.edu>
  2013-07-10 21:11                   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: ktm@rice.edu @ 2013-07-10 21:02 UTC (permalink / raw)
  To: lxnf98mm@gmail.com; +Cc: pgsql-admin

On Wed, Jul 10, 2013 at 03:46:28PM -0500, lxnf98mm@gmail.com wrote:
> On Wed, 10 Jul 2013, Vincent Lau wrote:
> 
> how would pg_upgrade be used to upgrade to a new machine
> use nfs?
> would i run pg_upgrade on the new server?
> 
> 

I would replicate to the new server from the old using WAL to get
an up to date copy of the DB. Shutdown the new copy and run pg_upgrade.
Then you can fallback to the old system if there is a problem.

Regards,
Ken


-- 
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] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:59     ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 19:02       ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:13         ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
  2013-07-10 19:19           ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 19:24             ` Re: Upgrading from 9.1 to 9.2 in place, same machine Vincent Lau <vincent.lau@rentrakmail.com>
  2013-07-10 20:46               ` Re: Upgrading from 9.1 to 9.2 in place, same machine lxnf98mm@gmail.com
  2013-07-10 21:02                 ` Re: Upgrading from 9.1 to 9.2 in place, same machine ktm@rice.edu <ktm@rice.edu>
@ 2013-07-10 21:11                   ` Vincent Lau <vincent.lau@rentrakmail.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Vincent Lau @ 2013-07-10 21:11 UTC (permalink / raw)
  To: ktm@rice.edu <ktm@rice.edu>; +Cc: pgsql-admin

On Wed, Jul 10, 2013 at 2:02 PM, ktm@rice.edu <ktm@rice.edu> wrote:

> On Wed, Jul 10, 2013 at 03:46:28PM -0500, lxnf98mm@gmail.com wrote:
> > On Wed, 10 Jul 2013, Vincent Lau wrote:
> >
> > how would pg_upgrade be used to upgrade to a new machine
> > use nfs?
> > would i run pg_upgrade on the new server?
> >
> >
>
> I would replicate to the new server from the old using WAL to get
> an up to date copy of the DB. Shutdown the new copy and run pg_upgrade.
> Then you can fallback to the old system if there is a problem.
>
> Regards,
> Ken
>
>
Either that, or I was thinking about doing a backup of the live cluster and
restore it to a test cluster. Then pg_upgrade the test cluster. Yes. It's a
little bit of work and I am sure there should be a better way to g about
doing this.

At least after all these, Oliver would be able to know how long it truly
takes to upgrade.



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



-- 
Vincent Lau | Database Administrator
503.284.7581 x394 | vincent.lau@rentrak.com <vincent.lau@rentrakmail.com>
RENTRAK | www.rentrak.com | NASDAQ: RENT

Notice: This message is confidential and is intended only for the
recipient(s) named above. If you have received this message in error,
or are not the named recipient(s), please immediately notify the
sender and delete this message.

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
  2013-07-10 18:08 ` Re: Upgrading from 9.1 to 9.2 in place, same machine Jonathan Nalley <jnalley@jnalley.com>
  2013-07-10 18:52   ` Re: Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
@ 2013-07-10 19:03     ` ktm@rice.edu <ktm@rice.edu>
  1 sibling, 0 replies; 15+ messages in thread

From: ktm@rice.edu @ 2013-07-10 19:03 UTC (permalink / raw)
  To: Wells Oliver <wellsoliver@gmail.com>; +Cc: pgsql-admin

On Wed, Jul 10, 2013 at 11:52:54AM -0700, Wells Oliver wrote:
> Can anyone speak to the speed of pg_upgrade? Our database is 153GB. From
> 9.1 to 9.2, I'm nervous it might take hours. If it were less than hour,
> downtime would be more acceptable.
> 

You can use the --link option and then you make hard links instead of
requiring a copy of the data files. It should be pretty fast. Without
--link a copy of 153GB could take a while. :)

http://www.postgresql.org/docs/9.2/interactive/pgupgrade.html

Ken


-- 
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] 15+ messages in thread

* Re: Upgrading from 9.1 to 9.2 in place, same machine
  2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
@ 2013-07-10 18:10 ` Chris Ernst <cernst@zvelo.com>
  1 sibling, 0 replies; 15+ messages in thread

From: Chris Ernst @ 2013-07-10 18:10 UTC (permalink / raw)
  To: pgsql-admin

On 07/10/2013 11:53 AM, Wells Oliver wrote:
> I'd like to move the 9.1 database to 9.2 without any down time, and
> ensuring that no data is lost.
> 
> My original idea was to make 9.2 a slave of 9.1, then switch it over.

You can't do this with streaming replication.  But you can with slony.
Just replicate from 9.1 as master to 9.2 as a slave.  Once they are
fully in sync, promote 9.2 to master.

Note that you will have to restart postgres at least once to move the
9.2 port to the same as the 9.1 port when you switch.  SO it won't be
zero down time, but pretty darn close.

	- Chris



-- 
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] 15+ messages in thread


end of thread, other threads:[~2013-07-10 21:11 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-07-10 17:53 Upgrading from 9.1 to 9.2 in place, same machine Wells Oliver <wellsoliver@gmail.com>
2013-07-10 18:08 ` Jonathan Nalley <jnalley@jnalley.com>
2013-07-10 18:16   ` ktm@rice.edu <ktm@rice.edu>
2013-07-10 18:52   ` Wells Oliver <wellsoliver@gmail.com>
2013-07-10 18:59     ` Vincent Lau <vincent.lau@rentrakmail.com>
2013-07-10 19:02       ` Wells Oliver <wellsoliver@gmail.com>
2013-07-10 19:12         ` Vincent Lau <vincent.lau@rentrakmail.com>
2013-07-10 19:13         ` ktm@rice.edu <ktm@rice.edu>
2013-07-10 19:19           ` Wells Oliver <wellsoliver@gmail.com>
2013-07-10 19:24             ` Vincent Lau <vincent.lau@rentrakmail.com>
2013-07-10 20:46               ` lxnf98mm@gmail.com
2013-07-10 21:02                 ` ktm@rice.edu <ktm@rice.edu>
2013-07-10 21:11                   ` Vincent Lau <vincent.lau@rentrakmail.com>
2013-07-10 19:03     ` ktm@rice.edu <ktm@rice.edu>
2013-07-10 18:10 ` Chris Ernst <cernst@zvelo.com>

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