Getting error while upgrading postgres from version 12 to 13

Started by shashidhar Reddyabout 3 years ago15 messagesgeneral
Jump to latest
#1shashidhar Reddy
shashidharreddy001@gmail.com

Hello,

I am in a process of upgrading postgresql from version 12 to 13 using
pg_upgrdrade but I am getting error stating

FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 13
, which is not compatible with this version 12.14 (Ubuntu
12.14-1.pgdg18.04+1)

Please help me on this issue.
--
Shashidhar

#2Ron
ronljohnsonjr@gmail.com
In reply to: shashidhar Reddy (#1)
Re: Getting error while upgrading postgres from version 12 to 13

On 3/18/23 15:39, shashidhar Reddy wrote:

Hello,

I am in a process of upgrading postgresql from version 12 to 13 using
pg_upgrdrade but I am getting error stating

 FATAL:  database files are incompatible with server
 DETAIL:  The data directory was initialized by PostgreSQL version 13
, which is not compatible with this version 12.14 (Ubuntu 12.14-1.pgdg18.04+1)

Please help me on this issue.

Show us the complete command you ran, pus all output.

--
Born in Arizona, moved to Babylonia.

#3shashidhar Reddy
shashidharreddy001@gmail.com
In reply to: shashidhar Reddy (#1)
Re: Getting error while upgrading postgres from version 12 to 13

and adding to this the following is also showing in the error, we tried
changing the file permissions but still no luck
FATAL: could not load private key file
"/etc/ssl/private/ssl-cert-snakeoil.key": key values mismatch

On Sun, Mar 19, 2023 at 2:09 AM shashidhar Reddy <
shashidharreddy001@gmail.com> wrote:

Hello,

I am in a process of upgrading postgresql from version 12 to 13 using
pg_upgrdrade but I am getting error stating

FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 13
, which is not compatible with this version 12.14 (Ubuntu
12.14-1.pgdg18.04+1)

Please help me on this issue.
--
Shashidhar

--
Shashidhar

#4Tomas Pospisek
tpo2@sourcepole.ch
In reply to: shashidhar Reddy (#3)
Re: Getting error while upgrading postgres from version 12 to 13

On 18.03.23 22:24, shashidhar Reddy wrote:

and adding to this the following is also showing in the error, we tried
changing the file permissions but still no luck
FATAL:  could not load private key file
"/etc/ssl/private/ssl-cert-snakeoil.key": key values mismatch

This sounds like the private SSL key you have configured is not the
private key for the public key you have configured - they do not match.
*t

#5Tomas Pospisek
tpo2@sourcepole.ch
In reply to: shashidhar Reddy (#3)
Re: Getting error while upgrading postgres from version 12 to 13

On Sun, Mar 19, 2023 at 2:09 AM shashidhar Reddy
<shashidharreddy001@gmail.com <mailto:shashidharreddy001@gmail.com>> wrote:

Hello,

I am in a process of upgrading postgresql from version 12 to 13
using pg_upgrdrade but I am getting error stating

 FATAL:  database files are incompatible with server
 DETAIL:  The data directory was initialized by PostgreSQL version 13
, which is not compatible with this version 12.14 (Ubuntu
12.14-1.pgdg18.04+1)

Please help me on this issue.

You have configured the postgres v12 server to use a directory where
there are data from a postgres v13 server. Evidently that can not work...
*t

#6shashidhar Reddy
shashidharreddy001@gmail.com
In reply to: shashidhar Reddy (#3)
Re: Getting error while upgrading postgres from version 12 to 13

Can someone please help me with this?

On Sun, 19 Mar, 2023, 2:54 am shashidhar Reddy, <
shashidharreddy001@gmail.com> wrote:

Show quoted text

and adding to this the following is also showing in the error, we tried
changing the file permissions but still no luck
FATAL: could not load private key file
"/etc/ssl/private/ssl-cert-snakeoil.key": key values mismatch

On Sun, Mar 19, 2023 at 2:09 AM shashidhar Reddy <
shashidharreddy001@gmail.com> wrote:

Hello,

I am in a process of upgrading postgresql from version 12 to 13 using
pg_upgrdrade but I am getting error stating

FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 13
, which is not compatible with this version 12.14 (Ubuntu
12.14-1.pgdg18.04+1)

Please help me on this issue.
--
Shashidhar

--
Shashidhar

#7Adrian Klaver
adrian.klaver@aklaver.com
In reply to: shashidhar Reddy (#6)
Re: Getting error while upgrading postgres from version 12 to 13

On 3/18/23 19:26, shashidhar Reddy wrote:

Can someone please help me with this?

You have already been helped:

/messages/by-id/ba59dd9b-6a87-ebff-c041-2dbcffe74a89@sourcepole.ch

"You have configured the postgres v12 server to use a directory where
there are data from a postgres v13 server. Evidently that can not work..."

On Sun, 19 Mar, 2023, 2:54 am shashidhar Reddy,
<shashidharreddy001@gmail.com <mailto:shashidharreddy001@gmail.com>> wrote:

and adding to this the following is also showing in the error, we
tried changing the file permissions but still no luck
FATAL:  could not load private key file
"/etc/ssl/private/ssl-cert-snakeoil.key": key values mismatch

On Sun, Mar 19, 2023 at 2:09 AM shashidhar Reddy
<shashidharreddy001@gmail.com <mailto:shashidharreddy001@gmail.com>>
wrote:

Hello,

I am in a process of upgrading postgresql from version 12 to 13
using pg_upgrdrade but I am getting error stating

 FATAL:  database files are incompatible with server
 DETAIL:  The data directory was initialized by PostgreSQL
version 13
, which is not compatible with this version 12.14 (Ubuntu
12.14-1.pgdg18.04+1)

Please help me on this issue.
--
Shashidhar

--
Shashidhar

--
Adrian Klaver
adrian.klaver@aklaver.com

#8David G. Johnston
david.g.johnston@gmail.com
In reply to: shashidhar Reddy (#6)
Re: Getting error while upgrading postgres from version 12 to 13

On Sat, Mar 18, 2023 at 7:27 PM shashidhar Reddy <
shashidharreddy001@gmail.com> wrote:

Can someone please help me with this?

You haven't given others enough information to help you. Present to the
fullest extent possible your current environment and the commands you are
running. Showing that psql itself works on both running clusters would be
a good start. Show inputs, not just outputs those inputs creates.

David J.

#9Abdul Sayeed
abdulsayeed24@gmail.com
In reply to: David G. Johnston (#8)
Re[2]: Getting error while upgrading postgres from version 12 to 13

Hello,

As per error it seems you have initiated source data with PG13 binaries. 

Could you please connect to both source and target psql and share out of select versions();

Also share pg_upgrade complete command which you are using. 

Regards,
Abdul Sayeed

Sent from myMail for iOS

Sunday, 19 March 2023 at 11:29 AM +0530 from david.g.johnston@gmail.com <david.g.johnston@gmail.com>:

Show quoted text

On Sat, Mar 18, 2023 at 7:27PM shashidhar Reddy < shashidharreddy001@gmail.com > wrote:

Can someone please help me with this?

You haven't given others enough information to help you.  Present to the fullest extent possible your current environment and the commands you are running.  Showing that psql itself works on both running clusters would be a good start.  Show inputs, not just outputs those inputs creates.

David J.

#10shashidhar Reddy
shashidharreddy001@gmail.com
In reply to: Abdul Sayeed (#9)
Re: Re[2]: Getting error while upgrading postgres from version 12 to 13

Actually I was using the below command to check the compatibility, it
worked without any issue with 12.6 but it is not working with 1version 2.14
time /usr/lib/postgresql/13/bin/pg_upgrade --old-bindir
/usr/lib/postgresql/12/bin --new-bindir /usr/lib/postgresql/13/bin
--old-datadir /usr/pgdata/pg_data --new-datadir /usr/pgdata/pg_data2 --link
--check

I have used a different directory for postgres13 from postgres 12.

On Mon, Mar 20, 2023 at 11:07 AM <abdulsayeed24@gmail.com> wrote:

Hello,

As per error it seems you have initiated source data with PG13 binaries.

Could you please connect to both source and target psql and share out of
select versions();

Also share pg_upgrade complete command which you are using.

Regards,
Abdul Sayeed

Sent from myMail for iOS

Sunday, 19 March 2023 at 11:29 AM +0530 from david.g.johnston@gmail.com <
david.g.johnston@gmail.com>:

On Sat, Mar 18, 2023 at 7:27PM shashidhar Reddy <
shashidharreddy001@gmail.com> wrote:

Can someone please help me with this?

You haven't given others enough information to help you. Present to the
fullest extent possible your current environment and the commands you are
running. Showing that psql itself works on both running clusters would be
a good start. Show inputs, not just outputs those inputs creates.

David J.

--
Shashidhar

#11Adrian Klaver
adrian.klaver@aklaver.com
In reply to: shashidhar Reddy (#10)
Re: Getting error while upgrading postgres from version 12 to 13

On 3/21/23 03:29, shashidhar Reddy wrote:

Actually I was using the below command to check the compatibility, it
worked without any issue with 12.6 but it is not working with 1version 2.14
time /usr/lib/postgresql/13/bin/pg_upgrade --old-bindir
/usr/lib/postgresql/12/bin --new-bindir /usr/lib/postgresql/13/bin
--old-datadir /usr/pgdata/pg_data --new-datadir /usr/pgdata/pg_data2
--link --check

I have used a different directory for postgres13 from postgres 12.

The issue is not that they are the same directory it is:

FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 13
, which is not compatible with this version 12.14 (Ubuntu
12.14-1.pgdg18.04+1)

Check the value that is the PG_VERSION file in each data directory. It
should be 12 in /usr/pgdata/pg_data and 13 in /usr/pgdata/pg_data2.

On Mon, Mar 20, 2023 at 11:07 AM <abdulsayeed24@gmail.com
<mailto:abdulsayeed24@gmail.com>> wrote:

Hello,

As per error it seems you have initiated source data with PG13
binaries.

Could you please connect to both source and target psql and share
out of select versions();

Also share pg_upgrade complete command which you are using.

Regards,
Abdul Sayeed

Sent from myMail for iOS

Sunday, 19 March 2023 at 11:29 AM +0530 from
david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>
<david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>>:

On Sat, Mar 18, 2023 at 7:27PM shashidhar Reddy
<shashidharreddy001@gmail.com
<mailto:shashidharreddy001@gmail.com>> wrote:

Can someone please help me with this?

You haven't given others enough information to help you.
Present to the fullest extent possible your current environment
and the commands you are running.  Showing that psql itself
works on both running clusters would be a good start.  Show
inputs, not just outputs those inputs creates.

David J.

--
Shashidhar

--
Adrian Klaver
adrian.klaver@aklaver.com

#12shashidhar Reddy
shashidharreddy001@gmail.com
In reply to: Adrian Klaver (#11)
Re: Getting error while upgrading postgres from version 12 to 13

Both shows different versions as 13 shows version 13.10 and 12 shows 12.14

On Tue, 21 Mar, 2023, 8:09 pm Adrian Klaver, <adrian.klaver@aklaver.com>
wrote:

Show quoted text

On 3/21/23 03:29, shashidhar Reddy wrote:

Actually I was using the below command to check the compatibility, it
worked without any issue with 12.6 but it is not working with 1version

2.14

time /usr/lib/postgresql/13/bin/pg_upgrade --old-bindir
/usr/lib/postgresql/12/bin --new-bindir /usr/lib/postgresql/13/bin
--old-datadir /usr/pgdata/pg_data --new-datadir /usr/pgdata/pg_data2
--link --check

I have used a different directory for postgres13 from postgres 12.

The issue is not that they are the same directory it is:

FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 13
, which is not compatible with this version 12.14 (Ubuntu
12.14-1.pgdg18.04+1)

Check the value that is the PG_VERSION file in each data directory. It
should be 12 in /usr/pgdata/pg_data and 13 in /usr/pgdata/pg_data2.

On Mon, Mar 20, 2023 at 11:07 AM <abdulsayeed24@gmail.com
<mailto:abdulsayeed24@gmail.com>> wrote:

Hello,

As per error it seems you have initiated source data with PG13
binaries.

Could you please connect to both source and target psql and share
out of select versions();

Also share pg_upgrade complete command which you are using.

Regards,
Abdul Sayeed

Sent from myMail for iOS

Sunday, 19 March 2023 at 11:29 AM +0530 from
david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>
<david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>>:

On Sat, Mar 18, 2023 at 7:27PM shashidhar Reddy
<shashidharreddy001@gmail.com
<mailto:shashidharreddy001@gmail.com>> wrote:

Can someone please help me with this?

You haven't given others enough information to help you.
Present to the fullest extent possible your current environment
and the commands you are running. Showing that psql itself
works on both running clusters would be a good start. Show
inputs, not just outputs those inputs creates.

David J.

--
Shashidhar

--
Adrian Klaver
adrian.klaver@aklaver.com

#13Adrian Klaver
adrian.klaver@aklaver.com
In reply to: shashidhar Reddy (#12)
Re: Getting error while upgrading postgres from version 12 to 13

On 3/21/23 08:13, shashidhar Reddy wrote:

Both shows different versions as 13 shows version 13.10 and 12 shows 12.

The question asked was:

"Check the value that is the PG_VERSION file in each data directory. It
should be 12 in /usr/pgdata/pg_data and 13 in /usr/pgdata/pg_data2."

So indicate which directory path has which PG_VERSION value.

While you are at it do:

/usr/lib/postgresql/13/bin/pg_upgrade -V

and post the version returned.

On Tue, 21 Mar, 2023, 8:09 pm Adrian Klaver, <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:

On 3/21/23 03:29, shashidhar Reddy wrote:

Actually I was using the below command to check the

compatibility, it

worked without any issue with 12.6 but it is not working with

1version 2.14

time /usr/lib/postgresql/13/bin/pg_upgrade --old-bindir
/usr/lib/postgresql/12/bin --new-bindir /usr/lib/postgresql/13/bin
--old-datadir /usr/pgdata/pg_data --new-datadir /usr/pgdata/pg_data2
--link --check

I have used a different directory for postgres13 from postgres 12.

The issue is not that they are the same directory it is:

FATAL:  database files are incompatible with server
  DETAIL:  The data directory was initialized by PostgreSQL version 13
, which is not compatible with this version 12.14 (Ubuntu
12.14-1.pgdg18.04+1)

Check the value that is the PG_VERSION file in each data directory. It
should be 12 in /usr/pgdata/pg_data  and 13 in /usr/pgdata/pg_data2.

On Mon, Mar 20, 2023 at 11:07 AM <abdulsayeed24@gmail.com

<mailto:abdulsayeed24@gmail.com>

<mailto:abdulsayeed24@gmail.com

<mailto:abdulsayeed24@gmail.com>>> wrote:

     Hello,

     As per error it seems you have initiated source data with PG13
     binaries.

     Could you please connect to both source and target psql and share
     out of select versions();

     Also share pg_upgrade complete command which you are using.

     Regards,
     Abdul Sayeed

     Sent from myMail for iOS

     Sunday, 19 March 2023 at 11:29 AM +0530 from
david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>

<mailto:david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>>

     <david.g.johnston@gmail.com

<mailto:david.g.johnston@gmail.com>
<mailto:david.g.johnston@gmail.com
<mailto:david.g.johnston@gmail.com>>>:

         On Sat, Mar 18, 2023 at 7:27PM shashidhar Reddy
         <shashidharreddy001@gmail.com

<mailto:shashidharreddy001@gmail.com>

         <mailto:shashidharreddy001@gmail.com

<mailto:shashidharreddy001@gmail.com>>> wrote:

             Can someone please help me with this?

         You haven't given others enough information to help you.
         Present to the fullest extent possible your current

environment

         and the commands you are running.  Showing that psql itself
         works on both running clusters would be a good start.  Show
         inputs, not just outputs those inputs creates.

         David J.

--
Shashidhar

--
Adrian Klaver
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

--
Adrian Klaver
adrian.klaver@aklaver.com

#14Geoff Winkless
pgsqladmin@geoff.dj
In reply to: shashidhar Reddy (#10)
Re: Re[2]: Getting error while upgrading postgres from version 12 to 13

On Tue, 21 Mar 2023 at 10:29, shashidhar Reddy <shashidharreddy001@gmail.com>
wrote:

Actually I was using the below command to check the compatibility, it
worked without any issue with 12.6 but it is not working with 1version 2.14
time /usr/lib/postgresql/13/bin/pg_upgrade --old-bindir
/usr/lib/postgresql/12/bin --new-bindir /usr/lib/postgresql/13/bin
--old-datadir /usr/pgdata/pg_data --new-datadir /usr/pgdata/pg_data2 --link
--check

Just in case I'm _not_ misreading this... are you saying you already ran
this command once with postgres v12.6?

If so, since you've used --link the original folder will no longer be
version12 data.

Geoff

Show quoted text
#15Geoff Winkless
pgsqladmin@geoff.dj
In reply to: Geoff Winkless (#14)
Re: Re[2]: Getting error while upgrading postgres from version 12 to 13

On Tue, 21 Mar 2023 at 16:06, Geoff Winkless <pgsqladmin@geoff.dj> wrote:

On Tue, 21 Mar 2023 at 10:29, shashidhar Reddy <
shashidharreddy001@gmail.com> wrote:

Actually I was using the below command to check the compatibility, it
worked without any issue with 12.6 but it is not working with 1version 2.14
time /usr/lib/postgresql/13/bin/pg_upgrade --old-bindir
/usr/lib/postgresql/12/bin --new-bindir /usr/lib/postgresql/13/bin
--old-datadir /usr/pgdata/pg_data --new-datadir /usr/pgdata/pg_data2 --link
--check

Just in case I'm _not_ misreading this... are you saying you already ran
this command once with postgres v12.6?

If so, since you've used --link the original folder will no longer be
version12 data.

No, I'm an idiot. Ignore me, I missed "--check".

Geoff