I’m not sure I’ve ever used Migration assistant, mostly because I do clean installs. With development and testing, it’s useful to have a clean slate every so often. I also frequently will install developer/beta or older releases to test something, or even keep an old piece of hardware working (like my Scansnap S510).
For years I had a simple text document where I’d keep track of various things I’d want setup/installed on a new Mac, but I rarely updated when quickly downloading a new tool in the middle of a project. So it was never perfect. Now I use the following steps/tools I use to setup a new macOS install, and some of this will be useful even after using migration assistant. Note much of this is done through the terminal, but it can be automated in a simple script if desired.
-
Install dotfiles in the home directory. If you don’t know what dotfiles are, you probably don’t have to worry about this. There’s no perfect way to do this, many developers use GitHub, but any cloud storage could be made to work and copy them to where they should be.
-
Install Xcode, these days that’s through the App Store.
- Install homebrew
Install Homebrew from the command line
# Check for Homebrew to be present, install if it's missing
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
-
Install packages from homebrew Tip: you can list installed packages on an old machine with “brew list”, but that also lists any dependencies required. “brew leaves” returns the packages with no other dependencies, so should be the list of things you choose to install.
Install homebrew packages script
# Update homebrew recipes
brew update
PACKAGES=(
bash
python
dnsmasq
exiftool
ffmpeg
go
hub
hugo
imagemagick
libdvdcss
ncurses
pyqt
ruby
sourcery
telnet
wget
)
echo "Installing packages..."
brew install ${PACKAGES[@]}
echo "Cleaning up..."
brew cleanup
-
Install 3rd party apps not from App Store. This used to be a very manual process, but homebrew comes to the rescue here too. homebrew supports pre-compiled apps in what they call “Casks”. Apps such as BBEdit, 1Password, Slack, Sketch, Chrome, Firefox, GraphicsConverter etc are all available. See homebrew-cask — Homebrew Formulae for a full list. The following shell script code will install all the listed apps automatically (my example will seem developer tool heavy, but note there are more “mainstream” apps as well):
Install 3rd party apps via homebrew Casks script
CASKS=(
iterm2
pycharm-ce
visual-studio-code
1password
bbedit
macdown
vlc
google-chrome
firefox
sequel-pro
private-internet-access
carbon-copy-cloner
docker
sublime-text
sketch
tower
postman
atom
github
graphicconverter
kindle
plex
transmission-remote-gui
)
echo "Installing cask apps..."
brew cask install ${CASKS[@]}
-
Install apps from the Mac App Store. This can be done by looking in the Mac App Store Purchased section under your account. But again it can be automated thanks to a little open source utility and a small amount of prep. GitHub - mas-cli/mas: Mac App Store command line interface
- Tip: searching through the mas CLI can be hit or miss, but the ID required to download or update a program can be easily found by copying the link from in the store and finding the ID in the URL.
Install apps from Mac App Store script
APPS=(
497799835 # Xcode
409203825 # Numbers
409201541 # Pages
409183694 # Keynote
1303222628 # Paprika
904280696 # Things3
816042486 # Compare Folders
640199958 # Apple Developer App
768053424 # Gapplin
421879749 # RESTed
# 425264550 # Black Magic Speed Test
# 413489665 # Cogs
)
echo "Installing Mac App Store apps..."
mas install ${APPS[@]}
-
Update System Preferences Use the CLI defaults to setup preferences for a clean install or a new account to match my preferences. A great references is available here, and a very thorough listing of many settings was created by Mathias Bynens. For example my favorite: disabling “Natural” scrolling can be done with one line:
Update System Preferences from command line
# System Preferences > Trackpad > Scoll & Zoom > Scroll Direction: Natural
defaults write "Apple Global Domain" com.apple.swipescrolldirection -bool false
- Misc
- Dock - There’s even a free CLI utility to manage dock icons. So if you don’t like the defaults that Apple puts in the dock, you can quickly remove them and put your own icons where you want them.
- DNS/Web/etc - usually anything you’ve done on the command line will need to be moved. I use dnsmasq for local web development, so anything like that.
That all sounds like a lot, and that’s where a very simple shell script can come in. I’m lazy, so again I freely admit I stole most of the work for what I use from others on the web. A clearly written one was posted earlier this year here.
By combining the scripts listed above, you can create one script that will do just the steps you want, and quickly get a clean install back to feeling like your own computer. And of course, there’s already people that have written fully controllable scripts to do all of these steps.
Note this won’t move any application preferences, but that’s where Migration Assistant should be very adept, especially as Apple changes application preference locations over the years.