Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Use /scripts/installpostgres without losing data

Discussion in 'Database Discussion' 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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,959
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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).
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,959
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice