The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Use /scripts/installpostgres without losing data

Discussion in 'Database Discussions' started by Mic1, May 29, 2015.

  1. Mic1

    Mic1 Member

    Joined:
    Feb 26, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. Mic1

    Mic1 Member

    Joined:
    Feb 26, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    #3 Mic1, Jun 1, 2015
    Last edited: Jun 1, 2015
  4. Mic1

    Mic1 Member

    Joined:
    Feb 26, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    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).
     
Loading...
Similar Threads - scripts installpostgres without
  1. Jerms
    Replies:
    3
    Views:
    906

Share This Page