That’s right! Last night i’ve finally upgraded my Mac OS 10.6.8 server to 10.7.4.
With some recent changes in our use in services and such and new discoveries i’ve made. And about a billion bug fixes and improvements from Apple i felt confident enough to upgrade the thing.
BEHOLD! DNS and DHCP now actually work!
It worked so well it was beyond comprehension. Until…
The quest begins:
To start with, i absolutely hate the OS upgrade via the App Store. For server it makes no sense at all. And it took me about an hour to get it working not including the 3 times i had to re-download the 4.2GB Lion image before it picked up the automated download of server.
Yea. You can’t just say “Install Lion Server” you have to download Lion first. Which then triggers the server part. Except the trigger didn’t work a 100 times before i “re-bought” Lion and Lion server. Luckily it was smart enough to know i had already bought it. But that triggered the Server download, finally.
After that, the server went on installing, rebooting, installing some more, rebooting (i think). I do everything on remote desktop and with the installation process that’s not available, so i just let it run blindly. Hearing the boot sound occasionally. This took a good hour and a half.
Then nothing. No churning disks or reboots for a while. But also no remote desktop coming back. Hmmm… Assuming a confirm or “I’m finished, have fun” dialog was waiting for me i hit enter. And after a few minutes of churning disks i was presented with the Lion boot screen.
Hoping things did go well, but fully expecting my Open Directory, DNS and DHCP to be broken. MySQL missing and all file shares corrupt. I barged straight in. Set the “natural” scrolling to how it should be and noticed my Minecraft server wasn’t going nuts over it’s share. It had logged in… And indeed Open Directory was working! A miracle!
When i moved the web folders into their new location i noticed something else… MySQL worked too… And that’s not even part of the core modules anymore. Last time i tried, the installer kindly removed everything non-default. Including MySQL. Now it was actually in the way with my plan. But no fear. So Terminal hackery later, MySQL was good and dead and in the trash! Ready for MySQL 5.5 to be installed with it’s handy Prefpane.
So far so good. File shares worked, users were kept, i actually had to break my database to replace it. And well, overall it just went fine. New printer drivers and a load of settings later i had this brilliant idea.
Let’s learn a trick or two:
And it was truly brilliant…
Let’s make a Open Directory Replica on the Minecraft server!!! Let’s learn something new!!!
So i re-setup Open Directory from Stand-alone to Open Directory Master. Which allows for sharing user accounts between compatible servers.
It migrated my stuff to the new database. Twitched, retched and died.
Kerberos active, Password Server and LDAP dead. Ohnoes! This allows everyone unlimited access to most things network since the passwords cannot be verified. So anything goes at that point. Bummer!
So i kill LDAP:
sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist
And Repair LDAP:
sudo /usr/bin/db_recover -c -h /var/db/openldap/openldap-data
Note the -c for severe corruption recovery!!
And then start LDAP:
sudo launchctl load /System/Library/LaunchDaemons/org.openldap.slapd.plist
Green telltale, yay! victory…
2 seconds later, grey telltale. False victory! 
The log claims the database cannot be opened and closed LDAP until a valid database is found. It would try to start the server from time to time though. Epic Fail!
Some Googling later; “It’s your best bet to demote the server to Stand-alone, hope it keeps the data and if not, restore your backup!”
Ah yes, the non-existant backup. But, my data is here and worked. So demoting it should not destroy the database just revert the latest changes.
And 3 minutes later I’m presented a pristine empty, neat new database.
The log tells me the data was corrupt and i should restore my database from my archive. *sigh*
Mmhm… That’s for 10.6.8. Too old. Moving on!
Upgrade the empty database to Open Directory Master. Add a user via “server.app” only to find that everything is greyed out… Huh?!?
Broken again? Or… I open Workgroup Manager, That works. So yet again if you use Open directory and ANYTHING that’s not within Apple’s beaten path you have to rely on the older tools because the new stuff fails. Great. So much for simplicity!
So i add my users, set the access rights, passwords, paths. File Sharing does find the users. And all seems well.
Meanwhile… On the minecraft server:
I convert it to Open Directory Replica. Assign the Master server to it. And it works. Aparently. But the timezone is ignored. So the logs are 2 hours off… Silly.
It seems to work though. Yay! Single accounts all over the network! And it only crashed once and didn’t require multiple re-installs. Huzzah!
Afterthoughts:
- Upgrade is now possible but a clean install still is better i think. As in – Wipe disk, install Leopard client, upgrade to Lion client. Install Lion Server.
- Apples upgrade process is flawed from the start (the failing trigger if you already own the software and thus don’t have the buy event first)
- Apples server management tools are not very user friendly. In fact, the whole way things work for me now is clumsy. Lion Server aims to be managed by Server.app. A glorified Server Preferences (Snow Leopard). But, some things are done in good old Server Admin. User management doesn’t work in Server.app when you use Open Directory which is done in the even older (it still lists Classic OS!!) Workgroup manager. So 3 apps instead of 2. And all 3 are horribly slow.
- MySQL (5.5.24) needs some tweaking with the socket and my.cnf or it won’t work.
- Access control Lists (ACLs) tend to conflict with each other if you use both file sharing and the web server due to their oversimplified approach. This forces you to compromise security in some ways.
- Using server.app for remote management is not very friendly and keeps trying to install server components on your client machine.
- Open Directory is still as fragile as ever yet is one of the most important services the server has to offer.