How to recover "On My Mac" Mailboxes?

For my wife I set up a “new (to her)” 2014 Retina iMac with a 1TB SSD to replace her old 2009 iMac with a spinning HDD. Everything is fine and all works well except that the “On My Mac” mailboxes, where she manually saved certain emails from friends, from the old 2009 iMac are not present on the “new” iMac and cannot be found on the TM or CCC backup disks (see picture below).

Here is pertinent background:
Old iMac: late 2009 iMac running High Sierra, 1TB HDD. External backup disks were made using Time Machine and Carbon Copy Cloner.

“New” iMac: 2014 Retina iMac with original Apple 1TB SSD. Previously was my iMac, running macOS Mojave, no problems. Set up for my wife by erasing SSD, formatted with APFS and “clean install” of macOS Mojave. Then I manually transferred data files - Documents, Desktop, photos (Photos Library.photoslibrary), Music, Movies, etc. Her iCloud, Mail, Dropbox and 1Password accounts were installed/set up without problems.

How can I recover the “On My Mac” mailboxes (“.mbox” files) from the old 2009 iMac? These are of course not present on the IMAP servers for her various email accounts.

After some digging around in my new 2020 iMac, I found the expected location of the “On My Mac” mailboxes (".mbox") files, located in the macOS “hidden” library folder: ~Library>Mail>V7>41E054EB- … (see attached photo). Apparently I should have exported these mailbox (.mbox) files from the old iMac’s Mail app, then import them into the new iMac’s Mail app. But I didn’t think ahead to do that :scream:

Apparently neither the TM nor the CCC backup disks contain the “hidden” library folder (see attached photo). A different library folder is present in the TM and CCC disks, but not the needed “hidden” library folder.

I still have the old 2009 iMac, but it is not usable because the 30-pin screen connector on the system board is broken. You can probably guess how this happened, but I won’t tell unless someone asks :grinning: )

I suppose I could remove the disk drive from the 2009 iMac, mount it in an external drive enclosure and access its data on my wife’s iMac or on my iMac. Would that method allow access to the “hidden” library folder? And is this necessary, or can I find the hidden library folder somewhere on the backup TM or CCC backup disks from the 2009 iMac?

I believe you may be looking for the folder in the wrong place. Your screenshot of the TM backup has /Library highlighted; you need to look in /Users/username/Library.

@jec0047 - Thank you, great suggestion but no luck. I already tried that, looking everywhere for another Library file, or anything that contained Mail, Apple, Application Support, or maybe Containers.

Below is another screenshot of two additional “Finder” pathways at the TM backup. The CCC backup is essentially the same.

I looked through the following iMac HD folders on the TM and CCC backup disks:
Library
System
Users/username/

Any other suggestions?

I’ll look at my TM disk later…

I looked at my TM disk and one of my SuperDuper clone drives, they both show /Users/jec0047/Library/Mail/V7/…

So I don’t know why your TM disk is different. Did you try looking at some other backups besides 2020-08-29-185916 ? Or maybe in the Dropbox folder?

@jec0047, thanks again.

I carefully looked in the TM backup drive in at least two dozen of the dated backups. There is no library folder in the /Users/username/ folder (only one user).

I also re-checked two CCC disk drives. For added insurance, I disconnected the original CCC drive 2 days before the changeover and made a 2nd CCC backup. Just like the TM backup drive, there is no library folder in the /Users/username/ folder in either of the two CCC backup drives.

Do you think it makes any difference that the 2009 iMac was running under macOS High Sierra?

Unless another solution is found, it appears that I must remove the HDD from the old 2009 iMac, mount it in an external drive enclosure and access it as an external drive.

High Sierra might have a v5 instead of v7 in the Mail folder, but otherwise should be the same.

1 Like

How comfortable are you with using the command line (e.g. in Terminal)?

1 Like

I have done some basic commands - for example, creating a bootable installer USB stick by copy-pasting the appropriate command in the terminal.

Many thanks to @jec0047 for generous help “offline” in private messages.

The solution was to use Terminal commands to find “.mbox” folders on the Time Machine or Carbon Copy Cloner backup drives, copy those folders to the new Mac and import them into Mail app.

Lessons learned:
TM and/or CCC backups are mandatory.
Learning basic Terminal commands is a valuable skill.
This talk.macpowerusers.com forum is quite helpful.

Edited to add -

And another lession:
Don’t rely on storing/archiving/saving email messages within the Mail app. If they deserved to be saved, export them to PDF files to be saved transparently in standard folders, not in a proprietary database. At the same time, delete the rest of the emails - meaning the 99% that don’t need to be saved.

1 Like

Yes, sadly I think almost everyone has learned the backup lesson from personal experience. Wish there was a way to convince people otherwise before they have an issue.

Terminal is powerful, I still resist it but I am slowly getting more comfortable with it as time goes on.

I Agree, this is one of ht most civil and most helpful forums around.

And the last, I am still thinking that part of my problem with my machine is due to me having tried to use mail as my storage for archive messages for 20+ years. I’m moving everything out into DEVONThink but any other option than mail is a good idea.

1 Like

Well said. The proprietary Mail database is well and truly hidden, and difficult to access by means other than the Mail app. Backup disk drives (TM, CCC and SuperDuper) are great, but substantial work remains to dig out the well-entrenched Mail data.

My understanding is that Devonthink stores its database in a more transparent way in an accessible ~Library/Application Support/ file (i.e., not “hidden” from Finder) and that its data (except for the database-related metadata) can be backed up and accessed outside the Devonthink app. This is an important difference from the Mail app. However, there is still the requirement for the user to take steps (perhaps in an automated way) to select and store emails within Devonthink.

I don’t need the sophisticated database features of Devonthink …

… so my wish is for an app or Mail plug-in to select emails (automatically and manually), convert them to PDF files, combine with attachments and place them in a specified macOS folder, perhaps using Hazel-like features to place them in sub-folders. Currently I am doing this manually - one by one - for emails I need to keep. Are there any developers out there who want to take a crack at this?

Keyboard Maestro could probably do this (I haven’t tried it though).

Perhaps. But that would be a project for another day - life is busy at the moment with medical issues.

I briefly looked into something similar and found a script meant to run from Mail that would combine an email message with attachments and send to a desired location or app - in this case to the Devonthink app. Here is a link:
https://discourse.devontechnologies.com/t/help-with-importing-emails-with-attached-pdf-files-to-dtpo/18617/4
The script shown in the link is quite involved and made me inclined to look for a turnkey commercial solution. I think the combining-with-attachments part is the challenge.

That script looks daunting but it’s really just the wordiness of AppleScript. I’m pretty sure it could be made to work. The question is how to invoke it.