pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Upgrading postgres to 10 from 9.5 using pg_upgradecluster
2+ messages / 2 participants
[nested] [flat]

* Upgrading postgres to 10 from 9.5 using pg_upgradecluster
@ 2017-11-11 02:32  Debraj Manna <subharaj.manna@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Debraj Manna @ 2017-11-11 02:32 UTC (permalink / raw)
  To: pgsql-admin

I am testing the process of upgrading postgres to 10 from 9.5

I am following the steps as mentioned in this link
<https://gist.github.com/dmitrykustov/27c673ec4f7abd716912e4c830910019; -

dmanna@ubuntu:~$ pg_lsclusters
Ver Cluster Port Status Owner    Data directory               Log
file9.5 main    5432 online postgres /var/lib/postgresql/9.5/main
/var/log/postgresql/postgresql-9.5-main.log10  main    5433 online
postgres /var/lib/postgresql/10/main
/var/log/postgresql/postgresql-10-main.log

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.5 main -m upgrade
sudo pg_dropcluster 9.5 main

Can someone let me know the following

   1. If there is a way I can check if the upgrade will be successful
   before going for the actual upgrade?
   2. If I am using the link option in the upgrade can I still use the sudo
   pg_dropcluster 9.5 main?

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

* Re: Upgrading postgres to 10 from 9.5 using pg_upgradecluster
@ 2017-11-11 11:26  Johannes Truschnigg <johannes@truschnigg.info>
  parent: Debraj Manna <subharaj.manna@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Johannes Truschnigg @ 2017-11-11 11:26 UTC (permalink / raw)
  To: Debraj Manna <subharaj.manna@gmail.com>; +Cc: pgsql-admin

Hi!

On Sat, Nov 11, 2017 at 08:02:19AM +0530, Debraj Manna wrote:
> I am testing the process of upgrading postgres to 10 from 9.5
> 
> [...]
> 
> Can someone let me know the following
> 
>    1. If there is a way I can check if the upgrade will be successful
>    before going for the actual upgrade?

Before doing a release upgrade, we usually restore the latest backup of the
cluster that's going to be upgraded to another host, and perform the planned
upgrade procedure there. For the actual upgrade, we schedule a maintenance
window, and repeaet the steps recorded during the successful test-run. This
has the added benefit that you can have confidence in your recovery/restore
process in case something goes awry.

There's no other way I know of that "simulates" performing the actual upgrade
(pg_upgrade does some pre-flight checking before it actually starts doing
work, but errors can still arise after the point of no return - which in
"link" mode means that you'll have two broken clusters, and will have to
restore from backup).


>    2. If I am using the link option in the upgrade can I still use the sudo
>    pg_dropcluster 9.5 main?

Yes.


It's a very good idea to gather experience with the workflow in a test setup,
just like you seem to be doing. You'll see that the procedure and tooling
around upgrades is very robust - but with database administration, nothing
beats a combination of diligent planning, carefulness, and experience.

-- 
with best regards:
- Johannes Truschnigg ( johannes@truschnigg.info )

www:   https://johannes.truschnigg.info/
phone: +43 650 2 133337
xmpp:  johannes@truschnigg.info

Please do not bother me with HTML-email or attachments. Thank you.

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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


end of thread, other threads:[~2017-11-11 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-11 02:32 Upgrading postgres to 10 from 9.5 using pg_upgradecluster Debraj Manna <subharaj.manna@gmail.com>
2017-11-11 11:26 ` Johannes Truschnigg <johannes@truschnigg.info>

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