Jump to content

Влади's Blog

  • entries
    5
  • comments
    2
  • views
    55,926

OS X Server update breaks PostgreSQL


Влади

2,019 views

 

The OS X Server 3.2.1 just released appears to break PostgreSQL during the update process. The new version of Postgresql installed (9.3.x over 9.2.x) contains an updated configuration field: “unix_socket_directory” becomes “unix_socket_directories”, the value doesn’t change, just the name.

The installer also appears to fail while upgrading the PostgreSQL data, causing the process to crash.

Thanks to the helpful users on the Apple Discussion boards here a fix has been found. As always, back up before you change anything!

To resolve the issue first stop the postgres service (2 commands) :

sudo su
serveradmin stop postgres 

Update the configuration field (1 command) :

pico /Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist
replace unix_socket_directory with unix_socket_directories
save & exit

Move the PostgreSQL data folder (1 command) :

mv /Library/Server/PostgreSQL/Data /Library/Server/PostgreSQL/DataOld

Recreate the standard PostgreSQL Data folder and initialise a blank database (1 command) :

sudo -u _postgres /Applications/Server.app/Contents/ServerRoot/usr/bin/initdb /Library/Server/PostgreSQL/Data -E utf8 --lc-collate=C --lc-ctype=C

Update the data in the blank database with data from the DataOld folder (1 command) :

sudo -u _postgres /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_upgrade -b /Applications/Server.app/Contents/ServerRoot/usr/libexec/postgresql9.2 -B /Applications/Server.app/Contents/ServerRoot/usr/bin -d /Library/Server/PostgreSQL/DataOld -D /Library/Server/PostgreSQL/Data

Restart the PostgreSQL service (2 commands) :

launchctl load -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/org.postgresql.postgres.plist
serveradmin start postgres

Source: Here

0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.