4 Replies Latest reply: Dec 14, 2012 8:38 AM by toddatkuapay
toddatkuapay Level 1 (0 points)

Hello,

 

I recently updated my OS X Mountain Lion Server version to 2.2 and I can't seem to find my device_management database in the postgres database?

 

I've been backing up my database and now can no longer find it.  When I start up profile manager it definitely starts up and has data in it?  Is there some other location for the database now?  WHAT Happened?

 

Any ideas would be helpful...

 

I currently see this:

 

  Name    |   Owner   | Encoding | Collate | Ctype |    Access privileges   

-----------+-----------+----------+---------+-------+-------------------------

postgres  | _postgres | UTF8     | C       | C     |

template0 | _postgres | UTF8     | C       | C     | =c/_postgres           +

           |           |          |         |       | _postgres=CTc/_postgres

template1 | _postgres | UTF8     | C       | C     | _postgres=CTc/_postgres+

           |           |          |         |       | =c/_postgres

 

where on my test Profile Manager machine with the same update I see this:

 

ostgres=# \l

                                  List of databases

       Name       |   Owner   | Encoding | Collate | Ctype |    Access privileges   

------------------+-----------+----------+---------+-------+-------------------- -----

device_inventory | _postgres | UTF8     | C       | C     |

postgres         | _postgres | UTF8     | C       | C     |

template0        | _postgres | UTF8     | C       | C     | =c/_postgres           +

                  |           |          |         |       | _postgres=CTc/_postgres

template1        | _postgres | UTF8     | C       | C     | _postgres=CTc/_postgres+

                  |           |          |         |       | =c/_postgres

test             | _postgres | UTF8     | C       | C     |


OS X Mountain Lion (10.8.2)
  • toddatkuapay Level 1 (0 points)

    Ok well I've found the database but can not find out how to connect and retrieve the data from it.  I need to backup my database and then use the data for an inhouse inventory database...

     

    Any help appreciated.

  • toddatkuapay Level 1 (0 points)

    So there are now 2 postgres servers running and I can't connect to the /Library/Server/PostgreSQL For Server Services...

     

    The reason for this is that psql is pointing to the original location of the socket directory.  By simply shutting down the 2nd instance of the Postgres database and linking the running socket in the original socket directory - you can connect to the /Library/Server/PostgreSQL for Server Services instance.

     

    Simply put:

     

    1.) launchctl remove org.postgresql.postgres

    2.) launchctl list | grep postgre

    3.) ln -s /Library/Server/PostgreSQL\ For\ Server\ Services/Socket/.s.PGSQL.5432 /var/pgsql_socket/.s.PGSQL.5432

     

    And you can connect to the database you need by:

     

    psql -U _postgres -d postgres

  • Peter Jurg2 Level 1 (60 points)

    You can also use:

     

    psql -U _postgres -h /Library/Server/PostgreSQL\ For\ Server\ Services/Socket/  -lt

  • toddatkuapay Level 1 (0 points)

    Peter - thank you!  That's a more elegant solution...