Apple macOS Server – Reset

If you’ve ran into a road block and need to reset the database and everything makes the profile manager work the scripts below will help.

I have had to do this personally after removing a device from profile manager and tried to add it again.

NOTE: You will need to reinput all the server information.

sudo /Applications/
sudo /Applications/
sudo serveradmin stop devicemgr
sudo serverctl disable
sudo serverctl disable
sudo killall -9 -u _devicemgr dmrunnerd devicemgrd migration_tool sd_relocator dmpgHelper
sudo mv /Library/Server/ProfileManager/Config/ServiceData/Data/PostgreSQL ~/.Trash/PostgreSQL_$RANDOM
sudo mv /Library/Server/ProfileManager/Config/ServiceData/Data/backup ~/.Trash/backup_$RANDOM
sudo /Applications/

In some case you may need to remove macOS Server and start completely over

sudo rm -rf /Applications/
sudo rm -rf /Library/Server


All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.