This has been a weekend of many tests:
In the Wiki source I backup the database OK:
servidor:~ admin$ sudo pg_dump -h "/Library/Server/Wiki/PostgresSocket" --format=c --compress=9 --blobs --username=collab --file=/temp2/collab.pgdump collab
But if immediately I try to restore from this file, this it´s what happen:
servidor:~ admin$ sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_restore -h "/Library/Server/Wiki/PostgresSocket" -d collab -U collab --single-transaction /temp2/collab.pgdump
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 685; 1247 16388 TYPE acl_action collab
pg_restore: [archiver (db)] could not execute query: ERROR: type "acl_action" already exists
Command was: CREATE TYPE acl_action AS ENUM (
'read',
'write',
'delete',
'own',
'*'
);
If I translate the Wifi folder to another machine
servidor:~ admin$ sudo cp -r /Library/Server/Wiki /temp2
cp: /Library/Server/Wiki/PostgresSocket/.s.PGSQL.5432: Operation not supported on socket
cp: /Library/Server/Wiki/PostgresSocket/.xpg.skt: Operation not supported on socket
cp: /Library/Server/Wiki/PostgresSocket/.xpg.skt.lock: No such file or directory
cp: /Library/Server/Wiki/PostgresSocket/.xpg_ctl.pid: No such file or directory
and if I try to restore the database to this folder I get this:
servidor:~ admin$ sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_restore -h "/Library/Server/Wiki/PostgresSocket" -d collab -U collab --single-transaction /temp2/collab.pgdump
pg_restore: [archiver (db)] connection to database "collab" failed: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/Library/Server/Wiki/PostgresSocket/.s.PGSQL.5432"?
In the logs:
27/07/14 22:06:44,680 collabd[7419]: [CSConnectionPool.m:196 c520000 +7838ms] Could not open a connection to Postgres. Please make sure it is running and has the correct access.
It seems the "restore sentence" it's not correct. Any idea?