I have a little development box which I upgraded to Debian 8.5 (to have a current apache and postgres which better match the productive servers). Now I have both Postgres 9.1 (old) and 9.4 (which I'd like to use):
$ systemctl | grep postgres postgresql.service loaded active exited PostgreSQL RDBMS email@example.com loaded failed failed PostgreSQL Cluster 9.1-main firstname.lastname@example.org loaded active running PostgreSQL Cluster 9.4-main system-postgresql.slice loaded active active system-postgresql.slice
The PostgreSQL 9.4 service was set automatically to serve on the non-standard port 5433, which I changed; now of course it is not possible to run both. I don't want to run both versions; I want PostgreSQL 9.4 to serve my existing databases.
I can recover to make my databases usable again like this:
$ systemctl stop email@example.com $ systemctl start firstname.lastname@example.org
This brings me back my databases, but of course with the outdated database engine.
How would I clean up this mess? Can I un-install version 9.1 without losing my data? Or should I export my databases and re-create them? What about system databases (
template1 and the like)?