Обсуждение: [GENERAL] Upgrading postgresql minor version

Поиск
Список
Период
Сортировка

[GENERAL] Upgrading postgresql minor version

От
Ron Ben
Дата:
I'm about to upgrade my postgresql to the latest 9.3 version
 
On my test server eveything works.
However I want to save a backup of my production server before the upgrade...
I'm not sure how I do that.
 
It says that only system files are changed during upgrade... which folders exactly I need to save on the side for roll back?
I know I can take a snap shoot of my server before the update but i'm affried that rolling back to this snap shoot will also roll back the data itself?
Since after the update the users continue to work I don't want to lose thier data.
 
How do I do that?

Re: [GENERAL] Upgrading postgresql minor version

От
Adrian Klaver
Дата:
On 05/10/2017 06:08 AM, Ron Ben wrote:
> I'm about to upgrade my postgresql to the latest 9.3 version
> On my test server eveything works.
> However I want to save a backup of my production server before the
> upgrade...
> I'm not sure how I do that.

https://www.postgresql.org/docs/9.3/static/app-pg-dumpall.html

> It says that only system files are changed during upgrade... which
> folders exactly I need to save on the side for roll back?

I would say that would depend on the nature of the release changes.

> I know I can take a snap shoot of my server before the update but i'm
> affried that rolling back to this snap shoot will also roll back the
> data itself?
> Since after the update the users continue to work I don't want to lose
> thier data.

Well if the upgrade takes then you don't need to rollback. If it did not
then the users did not get any work done or any data they entered would
be considered suspect. If you are concerned then take another pg_dumpall
before rolling back.


> How do I do that?


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: [GENERAL] Upgrading postgresql minor version

От
Jan de Visser
Дата:
On Wednesday, May 10, 2017 9:08:16 AM EDT Ron Ben wrote:
> ....

Ron,

You need to figure out how you can make your email client send something else
than base64 encoded HTML with right-aligned text. Your messages are so hard to
parse for me I just ignore them, and I assume there's other people that do the
same.

Attached a screenshot of one of your messages.



Вложения

Re: [GENERAL] Upgrading postgresql minor version

От
Ron Ben
Дата:

I think you miss understood me.
pg_dump dumps the data. the tables, functions and the data saved in them.
I have daily backups for this so i'm not worried.
 
What i'm woried about are the "executables files". These files are what is actualy being updated when you update the version.
I want to be able to roll them back in case of upgrade failure without rolling back the data.
 
 
Basicly what I want is to save on the side all the files that will be change by the update and in case of failure just to replace them back.
Is it doable? How?

ב מאי 10, 2017 16:27, Adrian Klaver כתב:
On 05/10/2017 06:08 AM, Ron Ben wrote:
> I'm about to upgrade my postgresql to the latest 9.3 version
> On my test server eveything works.
> However I want to save a backup of my production server before the
> upgrade...
> I'm not sure how I do that.

https://www.postgresql.org/docs/9.3/static/app-pg-dumpall.html

> It says that only system files are changed during upgrade... which
> folders exactly I need to save on the side for roll back?

I would say that would depend on the nature of the release changes.

> I know I can take a snap shoot of my server before the update but i'm
> affried that rolling back to this snap shoot will also roll back the
> data itself?
> Since after the update the users continue to work I don't want to lose
> thier data.

Well if the upgrade takes then you don't need to rollback. If it did not
then the users did not get any work done or any data they entered would
be considered suspect. If you are concerned then take another pg_dumpall
before rolling back.


> How do I do that?


--
Adrian Klaver
adrian.klaver@aklaver.com


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



Re: [GENERAL] Upgrading postgresql minor version

От
Andreas Joseph Krogh
Дата:
På onsdag 10. mai 2017 kl. 16:55:50, skrev Ron Ben <ronb910@walla.co.il>:
 
I think you miss understood me.
pg_dump dumps the data. the tables, functions and the data saved in them.
I have daily backups for this so i'm not worried.
 
What i'm woried about are the "executables files". These files are what is actualy being updated when you update the version.
I want to be able to roll them back in case of upgrade failure without rolling back the data.
 
 
Basicly what I want is to save on the side all the files that will be change by the update and in case of failure just to replace them back.
Is it doable? How?
 
What about just re-installing the previous version the same way you installed the "patch-release"-version?

--
Andreas Joseph Krogh
 

Re: [GENERAL] Upgrading postgresql minor version

От
Ron Ben
Дата:
Not possible 
https://www.postgresql.org/download/linux/debian/
 
To upgrade I do: apt-get install postgresql-9.3
There is no way to "roll back" from here.
I can not choose which version to install, it install the latest version packed for debian. Currently its 9.3.16
 
The docuntation says that upgrading minor version is just "replacing the executables", so there has to be a way to save them on the side for roll back.
If not, the documntation is insuffecent. We all know that sometimes even the smallest change can cause troubles.

ב מאי 10, 2017 18:02, Andreas Joseph Krogh כתב:
På onsdag 10. mai 2017 kl. 16:55:50, skrev Ron Ben <ronb910@walla.co.il>:
 
I think you miss understood me.
pg_dump dumps the data. the tables, functions and the data saved in them.
I have daily backups for this so i'm not worried.
 
What i'm woried about are the "executables files". These files are what is actualy being updated when you update the version.
I want to be able to roll them back in case of upgrade failure without rolling back the data.
 
 
Basicly what I want is to save on the side all the files that will be change by the update and in case of failure just to replace them back.
Is it doable? How?
 
What about just re-installing the previous version the same way you installed the "patch-release"-version?

--
Andreas Joseph Krogh
 


Re: [GENERAL] Upgrading postgresql minor version

От
Andreas Joseph Krogh
Дата:
På onsdag 10. mai 2017 kl. 17:13:50, skrev Ron Ben <ronb910@walla.co.il>:
Not possible 
https://www.postgresql.org/download/linux/debian/
 
To upgrade I do: apt-get install postgresql-9.3
There is no way to "roll back" from here.
I can not choose which version to install, it install the latest version packed for debian. Currently its 9.3.16
 
The docuntation says that upgrading minor version is just "replacing the executables", so there has to be a way to save them on the side for roll back.
If not, the documntation is insuffecent. We all know that sometimes even the smallest change can cause troubles.
 
Well - if you choose apt as you package-manager then this is really not an issue for PostgreSQL. What you're really asking is how to make apt install (or downgrade) a specific minor-version even if an updated version exists in the package-repo. Maybe you'll have more luck asking that other places than a PG-mailing-list.

--
Andreas Joseph Krogh
 

Re: [GENERAL] Upgrading postgresql minor version

От
Alan Hodgson
Дата:
On Wednesday 10 May 2017 17:13:50 Ron Ben wrote:
> Not possible
> https://www.postgresql.org/download/linux/debian/
>
> To upgrade I do: apt-get install postgresql-9.3
> There is no way to "roll back" from here.
> I can not choose which version to install, it install the latest version
> packed for debian. Currently its 9.3.16
> The docuntation says that upgrading minor version is just "replacing the
> executables", so there has to be a way to save them on the side for roll
> back. If not, the documntation is insuffecent. We all know that sometimes
> even the smallest change can cause troubles.
>

Download the old packages from the repository. You can use dpkg to manually
downgrade them if needed.  You can also use dpkg to get a list of the files in
any particular package if you want to save them manually.

Or you should ask your system administrator for help.

This is not a PostgreSQL issue and that's why it (and many other things) are
not in the docs. Every version of Linux uses a different package manager. The
system administrator needs to know how to use it.


Re: [GENERAL] Upgrading postgresql minor version

От
"David G. Johnston"
Дата:
On Wed, May 10, 2017 at 8:13 AM, Ron Ben <ronb910@walla.co.il> wrote:
Not possible 
 
To upgrade I do: apt-get install postgresql-9.3
There is no way to "roll back" from here.
I can not choose which version to install, it install the latest version packed for debian. Currently its 9.3.16
 
The docuntation says that upgrading minor version is just "replacing the executables", so there has to be a way to save them on the side for roll back.
 
​I see that the binaries involved are located under "/usr/​lib/postgresql" - in directories matching up with the version-cluster naming scheme the the apt packages employ.  In theory backing up and restoring the relevant directories under there should work.  This would only work for minor version switching.

If not, the documntation is insuffecent. We all know that sometimes even the smallest change can cause troubles.

​Maybe, but as noted its not the PostgreSQL project's ​documentation that is lacking here - since you are not installing from source.

I've never seen whether the upgrade process touches any other files, or exactly what it touches for that matter, but that should should be enough info to experiment.  It would be interesting to use Docker (or an equivalent) and perform an update and see what what the new layer shows as having been changed.

David J.

Re: [GENERAL] Upgrading postgresql minor version

От
"David G. Johnston"
Дата:
On Wed, May 10, 2017 at 9:34 AM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, May 10, 2017 at 8:13 AM, Ron Ben <ronb910@walla.co.il> wrote:
Not possible 
 
To upgrade I do: apt-get install postgresql-9.3
There is no way to "roll back" from here.
I can not choose which version to install, it install the latest version packed for debian. Currently its 9.3.16
 
The docuntation says that upgrading minor version is just "replacing the executables", so there has to be a way to save them on the side for roll back.
 
​I see that the binaries involved are located under "/usr/​lib/postgresql" - in directories matching up with the version-cluster naming scheme the the apt packages employ.  In theory backing up and restoring the relevant directories under there should work.  This would only work for minor version switching.

​My bad - its not cluster specific ... which makes sense as there is no way to update just individual clusters.

David J.​