Changing Services Settings in Yosemite Server

With Os X Server you can move the Service data.

Launch Server.app, then in the Settings pane you can edit the service Data by Clicking the Edit… button. But it’s all or nothing from the GUI.

If like me you’d like to move some Server Data but not all of them,
you’ll have to go CLI (Terminal).

Then, once done you’ll see in the GUI: Custom.

I want to move Datas for the Following Services that takes lots of Data Storage, and that I DO NOT want on the System’s Drive.

  • System has its own HDD,

  • DATAS have their own HDD.

Here are the DataRoot(s) I want to move :

  • Mail
  • Calendar and Addressbook (they share the same dataRoot)
  • Caching (can be done via the GUI)
  • SoftwareUpdate (can’t be done via the GUI)

Changing the Maildir DataRoot

Stop the Mail Service

sudo serveradmin stop mail

Move the data and folders hierarchy

EDIT : only the Mail data will be taken into account. until further notice, the rules and any others folders will stay in place.

HAVE to check if changing via the GUI changes something.

sudo ditto /Library/Server/Mail /Volumes/DATAS/Server/Mail

Change Mail Service Settings

sudo serveradmin settings mail:global:service_data_path = "/Volumes/DATAS/Server/Mail"
sudo serveradmin settings mail:imap:partition-default = "/Volumes/DATAS/Server/Mail/Data/mail"

Eventually Check your Settings before restarting the Mail Service.

sudo serveradmin settings mail

If like me you want to save that to a File

sudo serveradmin settings mail > ~/Desktop/Mail_settings.txt

(re)Start the Mail Service

sudo serveradmin start mail

Moving Calendar & AddressBook DataRoot

Stop Both Services as they share the same dataroot.

sudo serveradmin stop calendar
sudo serveradmin stop addressbook

Copy the DataRoot

sudo ditto "/Library/Server/Calendar and Contacts" "/Volumes/DATAS/Server/Calendar and Contacts"

Change the DataRoot Settings

sudo serveradmin settings addressbook:DataRoot = "/Volumes/DATAS/Server/Calendar and Contacts/Data"
sudo serveradmin settings calendar:DataRoot = "/Volumes/DATAS/Server/Calendar and Contacts/Data"

Restart Services

sudo serveradmin start calendar
sudo serveradmin start addressbook

Moving Caching DataRoot

Caching will cache (obviously) Apple AppStore, iTunes Store, Books.

Stop the Service if enabled

sudo serveradmin stop caching

Copy the DataRoot

sudo ditto "/Library/Server/Caching" "/Volumes/DATAS/Server/Caching"

Change the DataRoot Settings

sudo serveradmin settings caching:DataPath = "/Volumes/DATAS/Server/Caching"

(re)Start the Service if you like

sudo serveradmin start caching

Moving DataRoot for Software Update

(If you don’t plan to use Reposado)

Stop the Service if enabled

sudo serveradmin stop swupdate

Copy the DataRoot

sudo ditto "/Library/Server/Software Update" "/Volumes/DATAS/Server/Software Update"

Change the DataRoot Settings

sudo serveradmin settings swupdate:updatesDocRoot = "/Volumes/DATAS/Server/Software Update/Data"

(re)Start the Service if you like

sudo serveradmin start swupdate

Conclusion

Now you have moved Services that really take Big data Volumes

Olivier
About

Product and graphic designer turned to be a Mac SysAdmin.

Posted in Admin, Mac, tips tricks scripts Tagged with: , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>