After a system upgrade that included moving from rockstor-5.1.0 to 5.5.4 on x86_64 Slowroll, the postgresql service failed to start because the postgresql13 binaries were missing. Looking into this, it appears that postgresql13-server has now been removed from the TW/SR repos, and furthermore there is a file conflict with the latest version of the postgresql noarch package that forces postgresql13-server to be uninstalled during the upgrade. The procedure I ended up following that allowed me to get everything running again was:
- use
snapper rollbackto undo the upgrade - make backup copies of /usr/lib/postgresql13 and /usr/share/postgresql13
- upgrade rockstor and accept the solution to remove postgresql13-server
- restore the backups of /usr/lib/postgresql13 and /usr/share/postgresql13
At this point, postgresql would start, but rockstor-pre still failed on the initrock step, because it appears the version of django in the venv now requires postgresql>=14 and my database was still 13. So, I then did the following:
- stop the postgresql service
- rename ~postgres/data to ~postgres/data13
- start/stop the postgresql service to let it recreate the ~/postgres/data directory structure
- manually migrate the db with
sudo -u postgres pg_upgrade -b /usr/lib/postgresql13 -B /usr/lib/postgresql17 -d /var/lib/pgsql/data13 -D /var/lib/pgsql/data -r - manually optimize with
sudo -u postgres /usr/lib/postgresql17/bin/vacuumdb --all --analyze-in-stages(this was recommended by pg_upgrade, but probably wasn’t strictly necessary) - start the postgressql service
At this point, my database was version 17, and rockstor-bootstrap and rockstar-pre both ran successfully, so I re-ran the system upgrade and everything seems happy.
I hope this is helpful. I’m not really sure what steps rockstor could take to avoid this situation where a required package is forcibly uninstalled by the OS, but it’s possible it might be necessary to start keeping backups of the currently-used postgresql binaries in case they are needed for a migration.
Thanks for reading.