paint-brush
How I Migrated Applications and Data to a New Mac Without Time Machineby@ChrisChinchilla
128 reads

How I Migrated Applications and Data to a New Mac Without Time Machine

by Chris ChinchillaDecember 22nd, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

I recently migrated to a new mac and was interested to see how I might be able to leverage a couple of open source command line tools to help me along the path.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How I Migrated Applications and Data to a New Mac Without Time Machine
Chris Chinchilla HackerNoon profile picture

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.

Brew Bundle

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.

Mackup

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.

Synced Home Folder

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.

The Intended Process and Concerns

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:

  • Settings that are not supported by mackup.
  • Would Homebrew autodetect the architecture of the application to install?
  • Would Homebrew handle dependencies and “race conditions”? i.e., something another application might need that isn’t installed yet.
  • What about applications that are effectively package managers themselves. Such as Steam, Setapp, Itch, Gog, Creative Cloud, etc.
  • A handful of other random applications that aren’t available as Homebrew casks (yet) or can’t be for some reason. In my own personal case, these include one or two niche applications I am testing for people, some installers and drivers for hardware, and some other applications. Coincidentally they are almost all related to music and audio production 🤷‍♀️.
  • What about other large sources of files that are not in any form of cloud storage (iCloud, Dropbox, Creative Cloud, etc.) like my Photo library, git versioned folders (I am never sure I have pushed everything to remote repositories).

But with the old machine still available and backups in Time Machine and Backblaze, I had little to lose, so off I went.

What Happened?

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.

  • Applications that only have Intel versions required manually installing Rosetta 2 first, which is reasonable, but it would be good if Homebrew could handle it as it does with command line tools.
  • Some cask applications require inputting your password, but Homebrew diligently sits there waiting and then pickups the process again when you do.
  • The restore process identified several applications I had installed that were now deprecated, and nothing had informed me before.
  • There was one dependency (macFUSE for sshfs that wasn’t available in brew before for “reasons” that now was, and Homebrew prompted me to install it as a dependency first.
  • I had one brew formula that had no equivalent to work on Apple Silicon, even with Rosetta. This was a C debugger, so it is understandable.
  • Several times the process hung or timed out.

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.

Unanticipated Problems

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):

  • VSCode extensions and settings. Solved by turning on the now in-built settings sync.
  • I had to reinstall any application or game I wanted from another store or package manager. If you use Setapp, I did discover that it offers to install any application you marked as a favorite on a new launch.
  • I had to manually copy my image library for Snagit. I could solve this by relocating the library to cloud storage.
  • The stream deck application (something I use for programming the Elgato Stream Deck) keeps its settings in a way that you have to manually export and import all profiles and reinstall any extensions.
  • While most Rogue Amoeba applications synced perfectly with brew and mackup, Farrago (a sound deck application) didn’t, and I had to manually export and import sound sets. Also, in some cases, file locations and sound output devices could have changed.
  • While mackup synced preferences for Raycast (an awesome Spotlight/Alfred replacement), it didn’t sync extensions, there may be a way to add that support to mackup, or as a responsive community, they may add functionality.
  • Curiously, while iCloud syncs a lot of mail settings and mackup syncs others, email signatures get lost somewhere in the ether, and I had to recreate them.
  • I had to manually export and reimport my Brave wallet. I think this works as designed but is something that is easy to forget.
  • I had to export and reimport GPG keys from GPG keychain. I wonder if there’s a better way to handle this, or if it’s an intentional design for security.
  • I had issues with paths and some settings restoration between iTerm/Zsh/oh my zsh. I am not completely sure what went wrong, but it was another opportunity to clear out some acquired crud, and I got everything back to normal quickly. In fact, thanks to my symlinked zsh history, my terminal was almost like nothing had changed 🤓.
  • There are a handful of messaging applications that always require repairing with a mobile device.
  • There are one or two applications (don’t ask me to remember which 😬) that are just bad macOS citizens and don’t integrate well with anything and require some form of manual setup.
  • 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.

The Process Compared to Restoring From a Backup

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