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 <%2B65%206438%203504> | www.ashnik.com On Tue, Feb 25, 2020 at 5:35 PM Josef Šimánek 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.mihalides...@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 >> <https://www.cetin.cz/cs/jak-cetin-vyjednava-o-smlouve>. >> >> 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 >> <https://www.cetin.cz/en/jak-cetin-vyjednava-o-smlouve>. >> >
Re: Upgrade to 12.2 using same data directory
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 <%2B65%206438%203504> | www.ashnik.com On Tue, Feb 25, 2020 at 6:25 PM Mihalidesová Jana < jana.mihalides...@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 > *Sent:* Tuesday, February 25, 2020 1:23 PM > *To:* Mihalidesová Jana > *Cc:* Josef Šimánek ; > 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 <%2B65%206438%203504> | www.ashnik.com > > > > > > > > On Tue, Feb 25, 2020 at 5:35 PM Josef Šimánek > 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.mihalides...@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 > <https://www.cetin.cz/cs/jak-cetin-vyjednava-o-smlouve>. > > 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 > <https://www.cetin.cz/en/jak-cetin-vyjednava-o-smlouve>. > > > > 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
Re: Hot backup in PostgreSQL
Hi, If the requirement is to take online backup(hot) backup that can be used to do point in time recovery, you can rely on low-level API functionality mentioned earlier by Paul. If you to be care free about not missing any specific mount point other than default mount point, you can use pg_basebackup for online backup. Pg_basebackup will take care of backing up all database files including custom tablespace and has the option to compress the backup.You can refer to below link for more information. https://www.postgresql.org/docs/11/app-pgbasebackup.html On Thu, Oct 22, 2020 at 12:12 PM W.P. wrote: > Hi there, > > how to do "hot backup" (copying files) while database running? > > Not using pg_dump. > > Is there some equivalent of Oracle (I knew v8) "ALTER DATABASE BEGIN > BACKUP", which froze writes to database files, pushing everything to > redo files? > > > Laurent. > > > >
Re: Backup Restore from other node after switchover/failover
Hi Dirk, Yes, this will work fine. You can use the existing backup to restore it on the new node and use the WAL archives from new node for the recovery purpose. As a best practice, I would suggest setting the parameter "recovery_target_timeline=latest" in your recovery command to ensure the recovery happens along the latest timeline. Regards Sushant On Wed, Oct 28, 2020 at 2:53 PM Dirk Krautschick < dirk.krautsch...@trivadis.com> wrote: > Hi, > > > > haven’t tested it yet but maybe I can get a quick answer here. > > We have discussed the following scenario. > > > > Few nodes as streaming replication cluster all in sync with taking backup > > only from one dedicated node. Now that node which is responsible for the > backups > > goes down. For sure I have a full backup taken from that crashed node > > some time ago but now this node is gone and I have to take care for a > > restore for some reason. > > > > Am I able to make a full restore with that last backup from the offline > node > > to any other still existing node with Recovering the archived WAL from the > new > > selected node if I have activated archive_mode as “always”? > > > > Or is it strictly necessary to create a new full backup from the new node > > which is responsible for the backups after the failover or maybe after a > > Switchover, too? > > > > Thanks and best regards > > > > Dirk >