You want to migrate data to a new Mac but are also interested in using a clean install instead of restoring from a backup to remove any of that unnecessary crud that gathers, especially when you someone like me who constantly installs and uninstalls applications and tools.
I have been trialing a handful of tools and processes recently, building towards helping with this, and now I have a shiny new M1 Pro laptop it seemed a perfect time to see how useful they were.
Here’s what I wanted to test and how the process went.
Homebrew is amazing, hands down one of the best package managers there is. In addition to the more regular features you are likely familiar with is the
brew bundle
command that can bundle all the applications you have managed with homebrew core, cask (for GUI applications), mas (for Mac App Store installs), and whalebrew (for Docker images) into one dependency file. I’ve been on something of a mission to move as many of my applications as possible into a form of package manager, as opposed to loosely dragging applications to the Applications folder. This way, in theory, I can then run some commands on another computer, and everything is restored.A couple of years ago, someone showed me how operating systems like Nix work, and while macOS will always be far from the “everything is configuration” concept, this gets you part way there.
Less well-known but equally useful for my use case is Mackup, a utility that creates symlinks to the preferences (and other support files) of all supported applications and moves the real files to a storage you specify (I used a private GitHub repository). Again, if you first ensure you have access to that storage source on another machine, you can run mackup again to symlink them back into relevant folders for applications to pickup.
In addition to 90% of the work handled by brew and mackup I symlink a couple of other common home folder hidden configuration” files and folders into the same shared folder, including ssh keys, git configuration,” and zsh history.
I plan another blog post on this topic in the future.
Assuming my brew bundle and mackup backup processes are up to date, on the new machine, I run the reverse of the process (brew first, then mackup), and things will… mostly… work.
I had a handful of concerns and things I had a feeling might be a problem up-front. These were:
But with the old machine still available and backups in Time Machine and Backblaze, I had little to lose, so off I went.
With the ideal process defined, here’s what actually happened, the problems I discovered along the way, and how I solved them.
I turned on the laptop (kinda obvious), went through the setup, and logged in to my Apple account. I admit Apple has got much better with cloud services and keeping things in sync than they used to be (Does anyone else remember their shocking sync services of the past?), but they are still not flawless. Some preferences and files (and it’s hard to say what happened when) synced almost immediately, others (especially iCloud Drive, which is reasonable, took ages), while others (for example, Apple Mail accounts) kind of randomly just started working at some point. And why does Apple not let you sync applications installed from the App Store between machines automatically?
I copied the local git repository that contains my brew bundle and mackup files from a backup. I gave up copying my entire folder of git repositories until later, as I have always found that due to the hundreds of thousands of tiny files git tracks can mean copy operations take a long time.
I installed Homebrew, which prompted me to also install command line tools. So far, so reasonable. Then I ran a Brew bundle restore, and it mostly worked flawlessly, with caveats.
But in every case, rerun the restore process, and Homebrew would diligently pick up where it left off, and eventually, it completed successfully.
I then restored with mackup, and this was again flawless, and most applications worked immediately with my previous settings. One or two might have required re-authentication, but I can’t entirely remember. Even an application with more complex settings like OBS restored all its settings, profiles, and scenes.
Homebrew handled two of my earlier concerns automatically, installing the correct architecture and (most) dependencies for me. But there were a lot of small things I missed from restoring from a time machine backup that didn’t surprise me, but I forgot about. These are (so far):
Finally, I still needed to copy the remainder of my git folders, photo library, install creative cloud applications, virtual machines (though scratch that, they won’t work anyway 🙍♂️). As I have Apple One, I keep most of my other loose files and folders in iCloud Drive, so eventually, they all appeared back on the new machine.
All things considered, without contributing to Homebrew, mackup, and scripting a bunch of the other missing steps, I think this process took longer than restoring from a time machine backup and to be honest, I don’t think my fear of random disk clutter is that warranted. In the future, I would probably restore from a backup instead… Maybe…
Interestingly, a week or so later, my partner gained a new M1 MacBook Air, so I restored it from a backup for them, and I noticed something interesting. All of the non-Apple applications restored from the backup were the Intel versions (unless they were already Universal apps, I guess). This makes sense but ends up with a less than optimized setup, though I wonder if they will slowly update to the Apple silicon versions. I worry that not many users would even know there was a difference and thus end up with an experience that isn’t quite as good as it could be. For someone like myself who is obsessed with their computer running as streamlined as possible (😅), I would still then manually go through each application and ensure I had the Apple silicon version, and maybe that could take just as long. I am not even sure how that would work for command line tools installed with Homebrew. For this reason alone, I would possibly stick to my process, but with nothing to compare with (they don’t use Homebrew or really use any command line tools), it’s hard to be certain.
What about you? Do you always restore from a backup? Do everything from scratch? Something else?
Also Published Here