At CodingMammoth, we have a Jenkins that is running on a Mac Mini (2011) and is doing a set of tests and automated builds for a set of projects we have.
It’s a cheap and used machine we bought for some experiments and to have some CI tests running in the background. The 2011 model is one of the last models that allows customisation and where the RAM is not soldered on the main logic board… 🙁
The Mini was running macOS Sierra and is testing and building some iOS, macOS and NodeJS applications, and did the job perfectly. It was a bit slow, so one day I bought an SSD but I never found the time to perform the upgrade. Especially the upgrade-process looked scared and demotivating to delay it…
Mid December 2018, our CI broke as we updated a project to Xcode 10 which is not supported on Sierra, only on High Sierra and later, so our CI was failing on all builds of that project… Oops.
Right, well, a macOS update should fix that right? macOS Mojave couldn’t be installed on this model as only models 2012 or later are support. Bummer, but hey, there is still High Sierra, and Xcode 10 can be installed on High Sierra 🙌
The Mac App Store (MAS) is showing no results when you look for the High Sierra installer, luckily a download link can be found on the Apple Support page: Download High Sierra 🤷♂️
Anyway, after installing High Sierra… we were presented with a login window and our login credentials were rejected (even tried other keyboard layouts e.g.)… bummer… luckily we do have multiple backups (please do make backups!), and even a bootable clone (thanks to SuperDuper, I would recommend it!), but.. if we need to do a full restore and install, it is only a small extra effort to install finally that SSD, right?
We bought the iFixit “Dual Hard Drive Upgrade Kit” together with the SSD. Finally time to get it installed. The Mac Mini has place for 2 disks, but only is installed by default, so we installed the SSD at the second slot, as described in the guide.
Below are some pictures of the upgrade process. To be honest, I was quite scared to do the upgrade as you are literally going to empty the Mac Mini completely, plug in the disk, and fill the Mini again… but the guide is explaining it very detailed and it went smoothly without any issues. Please note that having the upgrade kit is useful as it includes all needed tools like the Mac Mini Logic Board Removal Tool.
After the SSD installation, it was (or should be…) just the case to get the software working again. We couldn’t boot from the old disk, as the login credentials were rejected. We tried to reset the passwords via the Recovery system but that failed.
We tried to do a clean install via the recovery kit, and selected our backup disk as “backup source”. This resulted in a corrupted installation… (after ~15 hours).
We discovered that our last bootable clone was bootable (hey, that does make sense 🙃), and we had the idea to clone this disk back to the Mac Mini disk. We will be still on Sierra, but at least the Mini would be back up and running, and using a SSD disk as main disk. This process took 12 hours (as the Mini as booted from the external disk, over USB 2.0) and we had to do it twice as the first restore resulted in a not-bootable disk (oops, always test your backups!).
Right, our CI was back up and running, but still failing as we couldn’t install Xcode 10. We reviewed the system settings, disk settings, and created an extra administrator account in case we are locked out again after upgrading to High Sierra. Before doing the upgrade, we decided to clone the SSD to the old internal HDD to have a restore point (like in the times of Windows XP 🤨) that we could use to restore from quickly.
After upgrading to High Sierra, we encountered the same problem, however, the new Admin user was still visible . After logging in, it seems that the macOS upgrade just removed our Jenkins user.. wait what? The user data of the Jenkins user was luckily still existing in /Users/Shared/Jenkins 🤯
Hmm.. right. We installed Jenkins via the guide written by @ved.pande which was a recent guide as we bought the Mini in 2016. Notice in the guide that you can access a “Advanced” panel in the System Preferences -> Users where you can set the path of a user 😱 So we decided to create a new Jenkins user, and change his home folder (/Users/Jenkins) to /Users/Shared/Jenkins.
Then we logged with the new user, which give, as you could have guessed, a lot of file permission errors. Disk Utility was not able to resolve those, luckily Apple wrote a document “Resolve issues caused by changing the permissions of items in your home folder” with some steps and a useful command that can fix the privileges in the ‘old’ user folder for the new user id. The command below was the fix for the privileges.
diskutil resetUserPermissions / `id -u`
After a reboot, and a very long startup process 🤷♂️, it seems that the new Jenkins user is correctly reading the old folder as user folder. The old desktop background appeared, the configurations were loaded and Jenkins started to work again. Great!
Next step was just updating Xcode and our CI machine was back up and running, using the SSD as main disk and doing backups (via TimeMachine) to the internal HDD, and periodical bootable clones to the external disk 🥳.
It took me 3 days to get the our CI back online. ~1 hour to install the SSD and 3 days for getting the macOS installation back working. Most of the time just waiting while the system was cloning itself over USB 😴 — Useless to say, but this also proofs the need of having frequent backup systems.
Oh, did I mention already we tried to start to recover the full internet? 🤣
(ok.. ok.. bad joke..)