Use /scripts/installpostgres without losing data

Mic1

Member
Feb 26, 2015
11
0
1
cPanel Access Level
Root Administrator
In order to fix an issue with phpPgAdmin not properly recognizing databases, I have been able to run /scripts/installpostgres --force, however, this process removes the data from all the databases and they have to be manually restored. Is there a way to backup/restore them all at once or to prevent that data loss to begin with?

It's a CentOS system with postgres (PostgreSQL) 8.4.20

I tried something like the following:
Switch to the postgres user and run pg_dumpall -f fullpsqlbackup
Switch to root user and stop postgres then move the existing /var/lib/pgsql database out of the way.
setup a new pgsql directory with proper permissions and run /scripts/installpostgres --force
Run service postgresql initdb
Fix postgres
Switch to postgres user and run cat /var/lib/pgsql.bak/fullpsqlbak | psql then go back to root and run fixpostgres once more.

Unfortunately I don't know a whole lot about Postgres and this may not be the best way to go about it. If someone could provide some insight, it'd be much appreciated.

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
In order to fix an issue with phpPgAdmin not properly recognizing databases, I have been able to run /scripts/installpostgres --force
Hello,

Have you tried resolving the issue without running that command? What's the specific issue you are encountering regarding the recognition of databases?

Thank you.
 

Mic1

Member
Feb 26, 2015
11
0
1
cPanel Access Level
Root Administrator
It looks like just running this directly also fixes it:
/usr/local/cpanel/bin/updatephppgadmin --force

Doing this prevents me from having to run installpostgres (which was resetting the password and making my formerly-created full backup not able to restore data).