Thread: Move configuration files with pg_upgrade

Move configuration files with pg_upgrade

From
Tanja Savic
Date:
Hello, 

I did Postgresql upgrade from v10 to v12 using pg_upgrade (on Linux Ubuntu server). 
Of course i wanted settings in pg_hba.conf and postgresql.conf to keep, but after the upgrade there were new configuration files and I moved it manually. 

Is it possible somehow to migrate these old 
configuration files with pg_upgrade or it shall be done manually? 

Cheers, 
Tanja

Re: Move configuration files with pg_upgrade

From
"Peter J. Holzer"
Date:
On 2020-06-04 19:52:19 +0000, Tanja Savic wrote:
> I did Postgresql upgrade from v10 to v12 using pg_upgrade (on Linux Ubuntu
> server).

Did you use the packages from the PGDG server or from Ubuntu?

> Of course i wanted settings in pg_hba.conf and postgresql.conf to keep, but
> after the upgrade there were new configuration files and I moved it manually.

I recently did an upgrade from 9.6 to 12 on a Debian system (using the
PGDG packages - I think they should be the same for Debian and Ubuntu)
and pg_uprade migrated the existing configuration without problems.
So that's not a general problem - did you get any error messages or
warnings during the upgrade?

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

Re: Move configuration files with pg_upgrade

From
Adrian Klaver
Date:
On 6/4/20 12:52 PM, Tanja Savic wrote:
> Hello,
> 
> I did Postgresql upgrade from v10 to v12 using pg_upgrade (on Linux 
> Ubuntu server).
> Of course i wanted settings inpg_hba.conf and postgresql.conf to keep, 
> but after the upgrade there were new configuration files and I moved it 
> manually.

That is documented:

https://www.postgresql.org/docs/12/pgupgrade.html

"
Restore pg_hba.conf

If you modified pg_hba.conf, restore its original settings. It might 
also be necessary to adjust other configuration files in the new cluster 
to match the old cluster, e.g. postgresql.conf.
"

The new version's conf files  will probably have new settings available 
so this is something that should be reviewed before moving over. One way 
to deal with this is include file(s):

https://www.postgresql.org/docs/12/config-setting.html#CONFIG-INCLUDES

Using them you create the settings you want to manage in the include 
file. Then copy that over and set the include 'some_file' in the new 
postgresql.conf and you are good.

> 
> Is it possible somehow to migrate these old
> configuration files with pg_upgrade or it shall be done manually?
> 
> Cheers,
> Tanja
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Move configuration files with pg_upgrade

From
Bruce Momjian
Date:
On Thu, Jun  4, 2020 at 03:26:07PM -0700, Adrian Klaver wrote:
> On 6/4/20 12:52 PM, Tanja Savic wrote:
> > Hello,
> > 
> > I did Postgresql upgrade from v10 to v12 using pg_upgrade (on Linux
> > Ubuntu server).
> > Of course i wanted settings inpg_hba.conf and postgresql.conf to keep,
> > but after the upgrade there were new configuration files and I moved it
> > manually.
> 
> That is documented:
> 
> https://www.postgresql.org/docs/12/pgupgrade.html
> 
> "
> Restore pg_hba.conf
> 
> If you modified pg_hba.conf, restore its original settings. It might also be
> necessary to adjust other configuration files in the new cluster to match
> the old cluster, e.g. postgresql.conf.
> "
> 
> The new version's conf files  will probably have new settings available so
> this is something that should be reviewed before moving over. One way to
> deal with this is include file(s):
> 
> https://www.postgresql.org/docs/12/config-setting.html#CONFIG-INCLUDES
> 
> Using them you create the settings you want to manage in the include file.
> Then copy that over and set the include 'some_file' in the new
> postgresql.conf and you are good.

Yes, the community instructions require you to reconfigure the new
server to match the old one.  Some packagers who automate pg_upgrade
might do that configuration migration automatically.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee