Best practices to move macOS Mail.app storage to an external drive

aliasexternal-diskmail.appmojavesymlink

I have a system with fairly small internal storage (500GB) so I have attached a reasonably quick external storage device (256GB) that will be constantly mounted. To free up space on the internal storage, I would like to move some data to the external can be formatted as either "MacOS Extended Journaeld"/HFS+ or APFS. The Mac itself is running macOS 10.14 "Mojave".

The simplest thing to move would be the Photos.app library as that can be done by just option-launching the program and selecting the library on the external, however the library is too large (around 300GB), and constantly growing, so that is not an option. Splitting the library into two is an option but then involves futzing with two libraries, and working with images in two libraries is not very well supported by Photos.app.

Email storage on the other hand is just the right size! However I am unsure exactly which folders are important, and the best way of providing the linkage so that everything works properly and is not frequently broken.

The following folders in the ~/Library folder seem to be Mail.app related:

~/Library/Mail
~/Library/Mail Downloads
~/Library/Containers/com.apple.mail

~/Library/Mail Downloads seems to be old with nothing inside it dated after 2013 – I gather that sometime in the 10.9 Mavericks era this was moved to inside ~/Library/Containers/com.apple.mail folder, so it can probably be ignored or even deleted after I look through it to make sure there is nothing of value inside.

So that leaves the two other folders. If I copy them to

/Volumes/external-drive/Mail-Storage/Library/Mail
/Volumes/external-drive/Mail-Storage/Library/Containers/com.apple.mail

and then make symbolic links at the expected places in the ~/Library folder will everything continue to work properly?

Would macOS aliases be preferred over Unix symbolic links? I think that if the name of the external-drive is ever changed, the symbolic links will break but macOS aliases would continue to work. The downside to an alias is that some lower-level Unix stuff does not know how to deal with the macOS alias. With that said, it looks like ~/Library/Containers/com.apple.mail is filled with all sorts of macOS alias files, so Mail.app does seem to be able to handle all of those.

This discussion Access to ~/Library/Containers/com.apple.mail/Data/ denied makes me think that Mojave's "entitlements" might make it challenging to move the entire ~/Library/Containers/com.apple.mail folder. Perhaps I should move the ~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads folder instead, since it seems to contain the majority of the data in the ~/Library/Containers/com.apple.mail folder.

So my inclination is to copy the two folders

~/Library/Mail
~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads

over to

/Volumes/external-drive/Mail-Storage/Library/Mail
/Volumes/external-drive/Mail-Storage/Library/Containers/com.apple.mail/Data/Library/Mail Downloads

and replace the local folders in ~/Library with macOS aliases to the folders in /Volumes/external-drive/Mail-Storage/Library/.

One extra thing to do is to make sure that the alias at

~/Library/Containers/com.apple.mail/Data/Library/Mail

which normally points to the folder

~/Library/Mail

properly resolves to the folder

/Volumes/external-drive/Mail-Storage/Library/Mail

which it might not do if it is not corrected.

Is that the best way to do this? Have I missed any issues?

I guess I should encrypt the external-drive so the data is safe if someone walks off with the device using either the Finder to encrypt all the data currently on the device, or using Disk Utility.app to reformat the device with encryption – details on both are here among other places.

Thanks in advance for any insights you can offer.

Best Answer

Photos

however the library is too large, and constantly growing, so that is not an option.

I don't understand the reasoning behind this. I assume you have more storage on your external drive than your internal drive. It's the perfect thing to move. New photos should be added to the external drive. Here is what apple is saying on the subject. https://support.apple.com/en-us/HT201517

Mail

I'd pick ln command so macOS above the Unix layer will not know that you moved the folders.

SymbolicLinker is a tiny contextual menu plugin that, once installed, allows any user to create symbolic links to files inside the Finder.

encryption

Is up to you. It's harder to recover data that's encrypted. Your data is less protected. You have to evaluate what your data is worth out in the wild. I never take my computer outside my house, so it's as safe as all my other stuff. I have an off site backup too.

backup

Do not forget to backup all you external data.