You are a homebrew user and you have a new Mac. If you don’t want to use Apple’s migration tool to copy over everything you might be faced with running
brew install [formula] for everything you have installed.
Unless you have a spare afternoon to do this you can achieve the same things with a few commands and be done in minutes, leaving you to get on with something more interesting.
On your old mac you can output a list of installed software from homebrew.
By piping this into a file you can create a text file containing all of your installed software.
brew list > homebrew.txt
Now you can copy this to your new Mac by Airdrop if you are on the same network,
scp or using a cloud service.
Once you have the file on your new Mac and assuming you have homebrew setup you can install all of the software with a single command
cat homebrew.txt | xargs brew install
You might find that homebrew has removed some formulae since you installed it. If this is the case just edit the file and remove the formula that is no longer available.
If you have your dotfiles in git repository you’ve suddenly got a pretty portable setup.
Have an update or suggestion for this article? You can edit it here and send me a pull request.
Using HashiCorp Vault with LDAP
How to use HashiCorp Vault to setup an LDAP backed secret store with read-only access for users in groups and read-write access for specific users
Linux and Unix xargs command tutorial with examples
Tutorial on using xargs, a UNIX and Linux command for building and executing command lines from standard input. Examples of cutting by character, byte position, cutting based on delimiter and how to modify the output delimiter.
Copy a file in Go
How to copy a file in Go. The ioutil package does not offer a shorthand way of copying a file. Instead the os package should be used.