Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

NOT able to browse all Postgres Databases (device_management) after the Server app update in Version 2.2

Hello to all.


After i installed the new update 2.2 for the Server.app i'm not be able to browse all databases in _postgres.

i can't see the device_management database.

i can see that in Library\Server\ there are two PostgreSQL folders. One is the classic and there is and a new one PostgreSQL For Server Services.

i suppose that the PostgreSQL for server services is a second Database instance but how i can connect to this via pgAdmin III?


it's critical to perform this connection ASAP.

any idea will be very Helpfull.


Thank you in advanced.

MacBook Pro, Mac OS X (10.7.2)

Posted on Dec 13, 2012 4:27 AM

Reply
16 replies

Dec 13, 2012 12:07 PM in response to SparkyArtt

OS X Server v2.2 now stores Postgres data needed by services in its own database ("/Library/Server/PostgreSQL For Server Services" by default). If you migrate from a previous version of OS X Server, system Postgres data will be migrated from /Library/Server/PostgreSQL to "/Library/Server/PostgreSQL For Server Services". Any custom content you may have created in /Library/Server/PostgreSQL will remain there after upgrading to OS X Server v2.2. If you wish to access this data, or if you're installing OS X Server v2.2 for the first time and wish to create new Postgres data, you may need to start the service with this command:

sudo serveradmin start postgres


This will start a Postgres process separate from the one used by services, which can be used to serve your own content.

About the OS X Server v2.2 Update

Dec 14, 2012 12:53 AM in response to Linc Davis

Linc Thank you for your responce.


the only thing i want to do is to connect to this news instance and browse the device_management database via pgadmin... it's not any custom data is just the device_management database (Profile Manager's data) can you please help me on this one ...

i tried to run sudo serveradmin start postgres but with no luck ...


i was not able to connect ...


Thank you again.

Dec 21, 2012 12:30 PM in response to joerg

just fyi:

reason i'm trying to get the postgres_server running is that my profile manager, wiki, calendar and contacts have been acting up since update to 2.2


i found that you have to use

/Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/backend/wipeDB. sh


but when i do that, i get:

devicemgr:state = "STOPPED"

postgres_server:error = "CANNOT_START_SERVICE_TIMEOUT_ERR"

(in /Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/backend)

Couldn't drop device_management : #<PGError: could not connect to server: Connection refused

Is the server running locally and accepting

connections on Unix domain socket "/Library/Server/PostgreSQL For Server Services/Socket/.s.PGSQL.5432"?

>

(in /Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/backend)

could not connect to server: Connection refused

Is the server running locally and accepting

connections on Unix domain socket "/Library/Server/PostgreSQL For Server Services/Socket/.s.PGSQL.5432"?

looking at the code of wipeDB.sh, it shows that it is trying to start postgres_server with

sudo $SERVER_ROOT/usr/sbin/serveradmin start postgres_server

if i look at the postgres_server with

sudo serveradmin fullstatus postgres_server

i get

postgres_server:dataDirHasBeenInitialized = yes

postgres_server:PG_VERSION = "9.2.1"

postgres_server:dataDir = "/Library/Server/PostgreSQL For Server Services/Data"

postgres_server:postgresIsResponding = no

postgres_server:dataDirIsDirectory = yes

postgres_server:PGserverVersion = 0

postgres_server:dataDirExists = yes

postgres_server:setStateVersion = 1

postgres_server:state = "RUNNING"


which shows that the server is running but it's not responding.


after a long search i ended up in this thread.


i think the problem is that my postgres_server is not working properly.


and i have no idea why...


any help/pointers GREATLY appreciated.

thanks

Jan 4, 2013 1:16 AM in response to Linc Davis

Linc hi again.

Sorry for the delay of my reply but i was out of office...


Ok as i can see i'm connected to the right instance .... how can i connect and prepare some quiries to the Device_management database.


postgres-# \l List of databases

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

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

caldav | caldav | UTF8 | C | C |

collab | collab | UTF8 | C | C |

device_management | _devicemgr | UTF8 | C | C |

postgres | _postgres | UTF8 | C | C |

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

| | | | | _postgres=CTc/_postgres

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

| | | | | _postgres=CTc/_postgres

webauth | webauth | UTF8 | C | C |

(7 rows)


i'm looking forward for your answer on this.

Thank you

Jan 4, 2013 1:54 AM in response to SparkyArtt

The paths to any Postgres binary should always be spelled out in full to ServerRoot inside Server.app, as the default versions in your path (in /usr/bin) are 9.14, vs 9.2.1 in the server.


So, to connect to the device_management database as its owner, _devicemgr, use:


/Applications/Server.app/Contents/ServerRoot/usr/bin/psql -h '/Library/Server/PostgreSQL For Server Services/Socket/' -U _devicemgr device_management;

Jan 4, 2013 6:42 AM in response to SparkyArtt

By specifying it, assuming pgadmin let's you do that. You'd have to check its documentation and/or config file for information about how to specify the use of a socket. I noticed in 10.7's Round Cube installation, a socket was specified with "unix(/var/pg_socket)" in place of the hostname. I tried to mimick that with Round Cube in 10.8, by specifying the host as "unix('/Library/Server/Postgres for Services/Socket/')", but that didn't work. So yeah, you need to find out his pgadmin requires you to specify a socket.

May 16, 2013 7:23 PM in response to SparkyArtt

I could connect to device_management via pgadmin by following settings...


Host: /Library/Server/PostgreSQL For Server Services/Socket

Port: 5432

MaintenanceDB: device_management

Username: _devicemgr


if the error msg shows "Is the server running locally and accepting connections on Unix domain socket "/Library/Server/PostgreSQL For Server Services/Socket/.s.PGSQL.5432"?", you could login with account root and try again.

NOT able to browse all Postgres Databases (device_management) after the Server app update in Version 2.2

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.