Обсуждение: Upgrade to 12.2 using same data directory

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

Upgrade to 12.2 using same data directory

От
Mihalidesová Jana
Дата:

Hi,

 

Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing of “new” cluster. Then pg_upgrade check fail.

 

 

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

 

 

Thx,

Jana



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.

Re: Upgrade to 12.2 using same data directory

От
Josef Šimánek
Дата:
I think that's not possible. What's the reason to reuse old directory?

út 25. 2. 2020 v 12:59 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

Hi,

 

Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing of “new” cluster. Then pg_upgrade check fail.

 

 

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

 

 

Thx,

Jana



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.

Re: Upgrade to 12.2 using same data directory

От
Sushant Pawar
Дата:
Hi Mihalidesová,

It should work with -k option. Can you share the error that you have received? You can execute pg_upgrade with -c option to identify any possible manual change required.


Best Regards,

Sushant Pawar | Database Solution Consultant

ASHNIK TECHNOLOGY SOLUTIONS PVT. LTD.

Skype: sush_531 | T: +91 9769559995 | www.ashnik.com




On Tue, Feb 25, 2020 at 5:35 PM Josef Šimánek <josef.simanek@gmail.com> wrote:
I think that's not possible. What's the reason to reuse old directory?

út 25. 2. 2020 v 12:59 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

Hi,

 

Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing of “new” cluster. Then pg_upgrade check fail.

 

 

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

 

 

Thx,

Jana



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.

RE: Upgrade to 12.2 using same data directory

От
Mihalidesová Jana
Дата:

I think it’s strange to change the data directory $PATH every time I upgrade the software, when the data are the same. I have a specific naming convention not using a db version.

 

/alias/data/<db_name>

 

J

 

From: Josef Šimánek <josef.simanek@gmail.com>
Sent: Tuesday, February 25, 2020 1:05 PM
To: Mihalidesová Jana <jana.mihalidesova@cetin.cz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Upgrade to 12.2 using same data directory

 

I think that's not possible. What's the reason to reuse old directory?

 

út 25. 2. 2020 v 12:59 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

Hi,

 

Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing of “new” cluster. Then pg_upgrade check fail.

 

 

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

 

 

Thx,

Jana



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.

Re: Upgrade to 12.2 using same data directory

От
Josef Šimánek
Дата:
I think it should be possible to rename old cluster data dir (you can use some suffix) and reuse your current directory name for upgraded cluster.

something similar to (not tested):
mv /alias/data/<db_name> /alias/data/<db_name>.old
./pg_upgrade -b $OLD/bin -B $NEWd/bin -d /alias/data/<db_name>.old -D /alias/data/<db_name> -k -c

út 25. 2. 2020 v 13:52 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

I think it’s strange to change the data directory $PATH every time I upgrade the software, when the data are the same. I have a specific naming convention not using a db version.

 

/alias/data/<db_name>

 

J

 

From: Josef Šimánek <josef.simanek@gmail.com>
Sent: Tuesday, February 25, 2020 1:05 PM
To: Mihalidesová Jana <jana.mihalidesova@cetin.cz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Upgrade to 12.2 using same data directory

 

I think that's not possible. What's the reason to reuse old directory?

 

út 25. 2. 2020 v 12:59 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

Hi,

 

Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing of “new” cluster. Then pg_upgrade check fail.

 

 

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

 

 

Thx,

Jana



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.

Re: Upgrade to 12.2 using same data directory

От
Ray O'Donnell
Дата:
On 25/02/2020 12:52, Mihalidesová Jana wrote:
> I think it’s strange to change the data directory $PATH every time I
> upgrade the software, when the data are the same. I have a specific
> naming convention not using a db version.

There's a lot to recommend keeping an untouched copy of your old data,
in case something goes wrong....

Ray.

-- 
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie



RE: Upgrade to 12.2 using same data directory

От
Mihalidesová Jana
Дата:

Hi,

 

The -k option doesn’t work. First is the problem to initialize new cluster to the same directory.

 

 

initdb: directory "$PATH" exists but is not empty

If you want to create a new database system, either remove or empty

the directory "$PATH" or run initdb

with an argument other than "$PATH".

 

 

And if I try to check upgrade from to same data directory

 

 

postgres@celpgsqld401.server.cetin:/pgsql/bin/12.2_nipjd/bin> ./pg_upgrade -b $OLD/bin -B $NEW/bin -d $PG_DATA -D $PG_DATA -k -c

Performing Consistency Checks

-----------------------------

Checking cluster versions

This utility can only upgrade to PostgreSQL version 12.

Failure, exiting

 

 

Jana

 

From: Sushant Pawar <sushant.pawar@ashnik.com>
Sent: Tuesday, February 25, 2020 1:23 PM
To: Mihalidesová Jana <jana.mihalidesova@cetin.cz>
Cc: Josef Šimánek <josef.simanek@gmail.com>; pgsql-general@lists.postgresql.org
Subject: Re: Upgrade to 12.2 using same data directory

 

Hi Mihalidesová,

 

It should work with -k option. Can you share the error that you have received? You can execute pg_upgrade with -c option to identify any possible manual change required.

 


Best Regards,

Sushant Pawar | Database Solution Consultant

ASHNIK TECHNOLOGY SOLUTIONS PVT. LTD.

Skype: sush_531 | T: +91 9769559995 | www.ashnik.com

 

 

 

On Tue, Feb 25, 2020 at 5:35 PM Josef Šimánek <josef.simanek@gmail.com> wrote:

I think that's not possible. What's the reason to reuse old directory?

 

út 25. 2. 2020 v 12:59 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

Hi,

 

Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing of “new” cluster. Then pg_upgrade check fail.

 

 

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

 

 

Thx,

Jana



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.

RE: Upgrade to 12.2 using same data directory

От
Mihalidesová Jana
Дата:

Yes,  that’s what I though, but the pre-upgrade check will be done with downtime.

Ok,

Thanks.

 

J

 

 

From: Josef Šimánek <josef.simanek@gmail.com>
Sent: Tuesday, February 25, 2020 1:54 PM
To: Mihalidesová Jana <jana.mihalidesova@cetin.cz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Upgrade to 12.2 using same data directory

 

I think it should be possible to rename old cluster data dir (you can use some suffix) and reuse your current directory name for upgraded cluster.

 

something similar to (not tested):

mv /alias/data/<db_name> /alias/data/<db_name>.old

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d /alias/data/<db_name>.old -D /alias/data/<db_name> -k -c

 

út 25. 2. 2020 v 13:52 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

I think it’s strange to change the data directory $PATH every time I upgrade the software, when the data are the same. I have a specific naming convention not using a db version.

 

/alias/data/<db_name>

 

J

 

From: Josef Šimánek <josef.simanek@gmail.com>
Sent: Tuesday, February 25, 2020 1:05 PM
To: Mihalidesová Jana <jana.mihalidesova@cetin.cz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Upgrade to 12.2 using same data directory

 

I think that's not possible. What's the reason to reuse old directory?

 

út 25. 2. 2020 v 12:59 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

Hi,

 

Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing of “new” cluster. Then pg_upgrade check fail.

 

 

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

 

 

Thx,

Jana



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.

Re: Upgrade to 12.2 using same data directory

От
Sushant Pawar
Дата:
Yes, Initdb will not work if there are existing cluster data files. 

You will have to initialize the  Postgres 12 cluster to a new data directory path and later you can use either pg_upgrade normal command or along with an in-place upgrade option. Just a note, make sure you have a  valid backup of the existing cluster before you start with the upgrade. 

initialize the new cluster 
initdb -D $PGDATA12

and then 

./pg_upgrade -b $OLD/bin -B $NEW/bin -d $PG_DATA -D $PGDATA12 -k -c   


Best Regards,

Sushant Pawar | Database Solution Consultant

ASHNIK TECHNOLOGY SOLUTIONS PVT. LTD.

Skype: sush_531 | T: +91 9769559995 | www.ashnik.com




On Tue, Feb 25, 2020 at 6:25 PM Mihalidesová Jana <jana.mihalidesova@cetin.cz> wrote:

Hi,

 

The -k option doesn’t work. First is the problem to initialize new cluster to the same directory.

 

 

initdb: directory "$PATH" exists but is not empty

If you want to create a new database system, either remove or empty

the directory "$PATH" or run initdb

with an argument other than "$PATH".

 

 

And if I try to check upgrade from to same data directory

 

 

postgres@celpgsqld401.server.cetin:/pgsql/bin/12.2_nipjd/bin> ./pg_upgrade -b $OLD/bin -B $NEW/bin -d $PG_DATA -D $PG_DATA -k -c

Performing Consistency Checks

-----------------------------

Checking cluster versions

This utility can only upgrade to PostgreSQL version 12.

Failure, exiting

 

 

Jana

 

From: Sushant Pawar <sushant.pawar@ashnik.com>
Sent: Tuesday, February 25, 2020 1:23 PM
To: Mihalidesová Jana <jana.mihalidesova@cetin.cz>
Cc: Josef Šimánek <josef.simanek@gmail.com>; pgsql-general@lists.postgresql.org
Subject: Re: Upgrade to 12.2 using same data directory

 

Hi Mihalidesová,

 

It should work with -k option. Can you share the error that you have received? You can execute pg_upgrade with -c option to identify any possible manual change required.

 


Best Regards,

Sushant Pawar | Database Solution Consultant

ASHNIK TECHNOLOGY SOLUTIONS PVT. LTD.

Skype: sush_531 | T: +91 9769559995 | www.ashnik.com

 

 

 

On Tue, Feb 25, 2020 at 5:35 PM Josef Šimánek <josef.simanek@gmail.com> wrote:

I think that's not possible. What's the reason to reuse old directory?

 

út 25. 2. 2020 v 12:59 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:

Hi,

 

Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing of “new” cluster. Then pg_upgrade check fail.

 

 

./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

 

 

Thx,

Jana



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.



Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani přijetí případného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a postupem podle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti. Smlouvy jsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány výhradně v písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s. přistupuje k jednání o smlouvě a jakými se řídí, jsou dostupné zde.

The content of this message is intended for communication purposes only. It does neither represent any contract proposal, nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or amendments thereto in a written form or in the form and the procedure in accordance with relevant general terms and conditions of CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on the basis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed or signed by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and under which it proceeds are available here.

Re: Upgrade to 12.2 using same data directory

От
Paul Förster
Дата:
Hi J,

you can do the following:

mkdir /alias/data/dbname-new
initdb -D /alias/data/dbname-new
pg_upgrade \
    -b /old/bin/dir \
    -B /new/bin/dir \
    -d /alias/data/dbname \
    -D /alias/data/dbname-new \
    -k

After the successful upgrade:

rm -rf /alias/data/dbname
mv /alias/data/dbname-new /alias/data/dbname

This is how I always do it. You can't initialize a new database cluster into the same data directory as the old
one(!!),which makes sense, but which is exactly what you are trying to do and why it fails on you. Doing it the way
describedabove has the advantages, that 

a) you don't need double disk space, espacially in a commercial environment, and which is ugly if pg_upgrade has to
copyterabytes of data, and 

b) saves time because there is no file copy, and

c) you then have the same data directory naming conventions that you are used to

Also see:

initdb --help
pg_upgrade --help

You can properly put this into a script. My last migrations (11.5 to 12.1) took about 18 seconds each. This
interruptionusually can be communicated to the users. 

If they're used to Oracle, they're used to interruptions in the range 90-120 minutes. :-D So there should be no
problemswith about a minute! But that of course requires proper planning and proper scripting. :-) Practice that
(includingthe scripting!) on an identical test database setup in advance. 

Hope this helps,
Paul


> On 25. Feb, 2020, at 13:52, Mihalidesová Jana <jana.mihalidesova@cetin.cz> wrote:
>
> I think it’s strange to change the data directory $PATH every time I upgrade the software, when the data are the
same.I have a specific naming convention not using a db version. 
>
> /alias/data/<db_name>
>
> J
>
> From: Josef Šimánek <josef.simanek@gmail.com>
> Sent: Tuesday, February 25, 2020 1:05 PM
> To: Mihalidesová Jana <jana.mihalidesova@cetin.cz>
> Cc: pgsql-general@lists.postgresql.org
> Subject: Re: Upgrade to 12.2 using same data directory
>
> I think that's not possible. What's the reason to reuse old directory?
>
> út 25. 2. 2020 v 12:59 odesílatel Mihalidesová Jana <jana.mihalidesova@cetin.cz> napsal:
> Hi,
>
> Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory? First problem is with initialing
of“new” cluster. Then pg_upgrade check fail. 
>
>
> ./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c
>
>
> Thx,
> Jana
>
>
> Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani
přijetípřípadného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a
postupempodle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti.
Smlouvyjsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány
výhradněv písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s.
přistupujek jednání o smlouvě a jakými se řídí, jsou dostupné zde. 
>
> The content of this message is intended for communication purposes only. It does neither represent any contract
proposal,nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or
amendmentsthereto in a written form or in the form and the procedure in accordance with relevant general terms and
conditionsof CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on
thebasis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed
orsigned by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and
underwhich it proceeds are available here. 
>
>
> Obsah této zprávy má výlučně komunikační charakter. Nepředstavuje návrh na uzavření smlouvy či na její změnu ani
přijetípřípadného návrhu. Smlouvy či jejich změny jsou společností CETIN a.s. uzavírány v písemné formě nebo v podobě a
postupempodle příslušných všeobecných podmínek společnosti CETIN a.s., a pokud jsou dohodnuty všechny náležitosti.
Smlouvyjsou uzavírány oprávněnou osobou na základě písemného pověření. Smlouvy o smlouvě budoucí jsou uzavírány
výhradněv písemné formě, vlastnoručně podepsané nebo s uznávaným elektronickým podpisem. Podmínky, za nichž CETIN a.s.
přistupujek jednání o smlouvě a jakými se řídí, jsou dostupné zde. 
>
> The content of this message is intended for communication purposes only. It does neither represent any contract
proposal,nor its amendment or acceptance of any potential contract proposal. CETIN a.s. concludes contracts or
amendmentsthereto in a written form or in the form and the procedure in accordance with relevant general terms and
conditionsof CETIN a.s., if all requirements are agreed. Contracts are concluded by an authorized person entitled on
thebasis of a written authorization. Contracts on a future contract are concluded solely in a written form, self-signed
orsigned by means of an advanced electronic signature. The conditions under which CETIN a.s. negotiates contracts and
underwhich it proceeds are available here. 




Re: Upgrade to 12.2 using same data directory

От
Laurenz Albe
Дата:
On Tue, 2020-02-25 at 11:58 +0000, Mihalidesová Jana wrote:
> Is there possibility to upgrade from 10.6 to 12.2 using exact same data directory?
> First problem is with initialing of “new” cluster. Then pg_upgrade check fail.
> 
> ./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c

No, but that is not necessary.

- Create a new cluster on the same file system as the old one.

- Run "pg_upgrade" with the -k option.

- Remove the old cluster and move the new one in the place of
  the old one.

- Start the server (with the new binaries of course).

Don't forget to ANALYZE.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com