Re: [ADMIN] Migrating from CentOS repo to PostgreSQL repo - Mailing list pgsql-admin

From Don Seiler
Subject Re: [ADMIN] Migrating from CentOS repo to PostgreSQL repo
Date
Msg-id CAHJZqBA4cSVwxQPALprC2GSNcNCVrhcd1Jk6RjoRLFgWK-vZKA@mail.gmail.com
Whole thread Raw
In response to [ADMIN] Migrating from CentOS repo to PostgreSQL repo  (Don Seiler <don@seiler.us>)
List pgsql-admin
I tested this out on my sandbox and things look like they're fine. Before starting up the new binaries, double-check the PGDATA environment variable (unless you manually specify -D every time).

Also I did receive this warning when uninstalling the old binaries:

    warning: file /var/lib/pgsql/data: remove failed: No such file or directory
    warning: file /var/lib/pgsql/backups: remove failed: No such file or directory

This is because we don't use those default locations and they didn't exist. That did make me concerned that removing those packages *would* try to remove existing database files, so tested with a default install into that PGDATA dir and then removed the packages. It looks like it left the datafiles alone, so my assumption is that it would only remove the "data" directory if it was empty. The backups directory was empty and was removed.

Don.

On Fri, Aug 11, 2017 at 3:06 PM, Don Seiler <don@seiler.us> wrote:
Howdy again listers.

In my stumbling around my new PostgreSQL surroundings, I found some inconsistency in a few of our 9.2 DB servers (all CentOS) in that some have installed postgresql-server from the CentOS7 base repository, where as others have installed postgresql92-server from the PostgreSQL repo. I've seen this with one of our 9.5 groups as well but I'm assuming the process will largely be the same.

I'd like to standardize all of these to use the postgresql.org repositories across the board. I'm wondering what the work involved is in doing so and not losing my database. Easy enough to test in a CentOS7 VM but just wanted to know if there were any known issues or tips to look for.

My initial guess at an action plan would be to:
  1. stop postgres
  2. Probably backup the config files
  3. Uninstall postgresql-server and other postgresql packages
  4. Pray that it didn't delete any data or config files?
  5. Configure the pgdg-centos92 repo in yum for that version of CentOS
  6. Install postgresql92-server from this repo
  7. Verify things start up.
  8. Look over any scripts that might have hard-coded binaries paths that have changed.
As always, looking forward to learning more and seeing what you all think.

Don.

--
Don Seiler
www.seiler.us



--
Don Seiler
www.seiler.us

pgsql-admin by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: [ADMIN] Shutdown Order with Primary/Standby?
Next
From: Aleksander Kamenik
Date:
Subject: [ADMIN] avoiding split brain with repmgr