When you buy a new Mac there is an easy way to migrate all of you data, programs, settings, logins: Just use the Migration Assistant. Most of the times it works magically. You basically end up with a 1:1 system after the migration. Awesome!
The downside: you are always carrying old crap with you. Old software and other stuff you were piling on your system. On my old Mac AWS CLI suddenly stopped working and I was unable to quickly repair it using homebrew, pypi or any other approach. I like to work from Docker containers so that was not a huge issue. But migrating that broken system to a fresh new MacBook? Not so much!
Nowadays, most of my documents, passwords and settings are in iCloud because of the many Apple devices that I use all the time. So why bother migrating all the old crap, if you can have a clean install. It is my first time using this approach since 2005.
Previously, on Windows, migrating was not an option. Win got corrupt in such unpredictable ways and migration routines just didn’t work as expected. It was a relief to get a clean system. But then you started with an empty box. No software, no settings, no data, no favorites… Hours and hours of setup time.
OK, back to the issue at hand: We have a new system, download the software and configure some special custom settings (key shortcuts and other system and application preferences. BTW @Apple, why are settings not stored in iCloud?), and we are mostly done.
But what about mail? I’ve been storing mail in local folders on a yearly basis. I want my stuff to be local. It is private and I want full control over it, so I use POP3 and have old mails on one of my Macs. After the end of each year I grab all the mails from the inbox and put them in a newly created year folder (2021 e.g.). It is not polluting my inbox anymore, but it’s still searchable in Mail. It is such a comfortable thing to have 15 years of emails available at all times. Mail search is truly amazing!
With Migration Assistant mail gets transferred 1:1. When you do a fresh install, you loose all old mails. What can we do about that?
The solution: Migrating only Mail to the new Mac
A word of caution: This procedure worked for me. Don’t hold me accountable if it doesn’t work for you. Backup your data and be prepared to restart from scratch if needed. The procedure was tested only with the same version of MacOS on both systems with iCloud passwords turned on.
Apple Mail is stored in your user’s home directory in the Library folder ~/Library/Mail, so we will copy those directories to the new Mac. However, we also need to copy ~/Library/Accounts, where the Mail account info is stored. If you are using iCloud passwords, that seems to be all we need to copy.
Fetch new incoming mail on the old Mac, then stop Mail on both Macs. On the new Mac backup all files and folders in the ~/Library/Mail and ~/Library/Accounts folders by appending “.old” to the file and folder names. Then copy all contents of these two folders from the old Mac to the new. Start Mail on the new Mac. That’s it. You should already see all mailboxes set-up correctly.
In my case Mail search didn’t work correctly, so I additionally had to reset the search index (see https://www.macobserver.com/tips/how-to/fixing-broken-mail-search-macos/): Stop Mail app on the new Mac, restart it while holding shift key when clicking on the Mail icon. Mail starts, stop it again and repeat with shift key. Then stop Mail and restart your Mac. After this procedure, your search index will be rebuilt (which is going to take some time). Done!
This worked for me, so I hope it is going to be helping you, too!