Re: Postgres upgrade from 12 to 13 - anyway to fetch EOL package?

From: Kaya Saman <kayasaman_at_optiplex-networks.com>
Date: Fri, 11 Jul 2025 13:19:43 UTC
On 7/10/25 8:19 PM, list_freebsd@bluerosetech.com wrote:
> On 2025-07-10 1:55, Kaya Saman wrote:
>> I've recently updated my servers to 13.5 and now I'm updating all the 
>> @ports
>>
>>
>> I have a jail with postgres installed but forgot to check
>> /usr/ports/UPDATING for the upgrade procedure.
>>
>>
>> Does anyone know if there's a location with obsolete packages so I can
>> grab the pg12 package?
>>
>>
>> According to UPDATING I need both of these:
>>
>>
>>     # pkg create postgresql12-server postgresql12-contrib
>>     # tar xf postgresql12-server-12.8.pkg -C /tmp/pg-upgrade
>>     # tar xf postgresql12-contrib-12.8.pkg -C /tmp/pg-upgrade
>>
>>
>> Or is there another solution to get my databases upgraded?
>
> Check to see if you have the old pkgs in /var/cache/pkg
>
> If not, you can look up when databases/postgresql12-* was deleted from 
> the tree, check out ports at the commit just before that, make stage 
> package, unpack as needed.


Many thanks for the suggestion!


Currently I found the source code from here:


https://ftp.postgresql.org/pub/source/v12.8/


I'm not sure which version of 12.x was installed but I'm trying 12.8 in 
any case. I don't think I need to install it? Right now I just ran the 
"make" command.


Hopefully then it will just be a case of following the instructions from 
'post 2' from here:


https://forums.freebsd.org/threads/pkg-upgrade-installations-of-postgresql13-client-then-conflicting-postgresql12-client-and-then-an-sqlite-error.82931/


su -l postgres -c "pg_upgrade -b /tmp/pg-upgrade/usr/local/bin/ -d 
/var/db/postgres/data10 -B /usr/local/bin/ -D /var/db/postgres/data13/ 
-U postgres "


- but using data12 instead ;-)


I think I would need to adapt this line to:


"/tmp/postgresql-12.8/src/bin/pg_upgrade 
-b /tmp/postgresql-12.8/src/bin" as the source directories