How to use Apple export script to import to Thunderbird
I have a load of local folders in Apple Mail (NOTE: It's running on OSX 10.14 Mojave, old style)i. exported these from Mac Mail which took a few hours at least.
I have followed instructions to import into TB via this plugin. Tried every option possible but fails every time with message: "Import Done 0/0"
Any ideas appreciated.
@johnstonesnow What explicitly are you importing, a single mbox or a structure produced from the script we discussed? @cleidigh
I exported all my local mail using Mac Mail's export mailboxes function. So I have a nested tree structure with folders and mboxes. I haven't (couldn't!) use any 'scripts'. I read somewhere that because I am using a very old OS (Mojave), the Mail export should work with this plugin.
@johnstonesnow As far as I have seen, nothing is different with Mojave. For apple structured exports you have to transform the structure to Thunderbird structure with the script. IETNG can then import. @cleidigh
Ok, that would explain it. But I have no idea what script, I know the thread you're referring to but I can't follow it now it's gone into technical stuff. I am not a dev, but even if I was, I thought the last I read was that the script is broken and nobody has time to fix it, is that right or is there something working that you think it might be worth trying to learn how to run? Thanks
@johnstonesnow No problem, I will back up. Here is the script and instructions https://github.com/thunderbird/import-export-tools-ng/wiki
The most important thing is to make a backup of your export because the script modifies the tree in place. Since it might take a couple of tries you want the backup to start over. We thought the script might have a problem, but that was a user issue. I did a small transform on Windows. @cleidigh
Thanks. Yes I took a zip backup to burn and put in safe for keeps. Let's see if I can work out how to follow these instructions!
@johnstonesnow You will want your backup on your system ready to recopy. First thing you want to do is run the script with no arguments just to see python and the script are good.. Next try using the path to the top of the export. That directory should have a subdirectory with a .mbox suffix. Report the resulting structure. Christopher
Hmm, as suspected, it's not for average folks, dev-types only! but I am trying. I checked with "python" command in terminal and i have python 2 running, so I am downloading a Python3 installer.
But I will be stuck when i get that installed.
"An experimental script to restructure an Apple Mail export, applembox2sbd.py, is available in the utility-scripts folder of this repository."
I can see a page of code at the link, but what do I do with it?
Thanks
download the script with the raw link. Once you have python 3, you should be able to run it. Christopher
@johnstonesnow You will want your backup on your system ready to recopy. First thing you want to do is run the script with no arguments just to see python and the script are good.. Next try using the path to the top of the export. That directory should have a subdirectory with a .mbox suffix. Report the resulting structure. Christopher
Thanks, but I hardly understood a word. I have backup (duplicate folder) of my exported tree. No idea how to run a script, don't know what arguments are, sorry!
I clicked the "raw" button and got a full page of the code/script
do I copy that and paste into terminal or something?
Hmm. I installed the python3 installer package. it completed successfully. To confirm I went to terminal and typed "python" again, hoping to see V3 installed but it still says V2:
"Python 2.7.10 (default, Feb 22 2019, 21:55:15) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin Type "help", "copyright", "credits" or "license" for more information."
Do I need to reboot for it to take effect?
I have to run out but will be back in an hour or two to make some attempt at running this script. Just bear in mind I have no clue about making directories in terminal, or even finding a directory. Only way I have ever got a file location into terminal is by dragging and dropping a finder folder at the end of a command. I will have a go later on but any dumba55-friendly tips would be appreciated :)
yes copy and save as the script name
hmm I don't know how to make python 3 the default. Did the installer mention anything on this? I don't want to mess up your current system especially since you are not a developer. The other possible approach is to use your Linux target which probably has python 3 Christopher
just looked. you should try python3 that should invoke version 3
@johnstonesnow Ok, we will do our best. I wish I had a solution that was simpler, but it's the nature of a lot migration scenarios. I think we can do it, I will do my best. Once you try the python3 command we will go from there. Not everyone is a developer, no dumba55 required %-) Christopher
hehe, thanks. Re messing up this machine, no worries there. It's my last iMac (a very old one that's being used for zeroing my rifle once this job is done, and no I am not joking).
python3 - that did it :) ...
"Python 3.12.2 (v3.12.2:6abddd9f6a, Feb 6 2024, 17:02:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license" for more information."
So... "copy and save as the script name". By that do you mean use the browser menu to "save as html" to save to my computer then rename the file "apple2mboxsbd.py" ?
@johnstonesnow I'm on East coast time, but usually online by 12:00. I will be online until around 6:30. Let me know when you want to "live walk through" In the meantime I will post some steps and notes. I will also fire up my MacAir which I think has Mojave also. Christopher
Hi, that's extremely kind of you. I am sitting down for an hour (minimum) now. I am hopeful it won't take too much time, just need to learn how to run the script. I do have Python3 installed now, so that's a step in the right direction. I have the Mac Mail export (with duplicates) ready to try a conversion. thanks very much
@johnstonesnow Sorry, Just got moved to bed, I'm disabled with ALS so do programming by eyes and don't have a lot of time now. If you are still on we can do a bit. I would like you to create a new directory right under your home directory for ease. Name it mboxcvt. We will download the script there next. We can do these first few steps with Finder then we will have to use the terminal. C
Hi Christopher, sorry to hear that. I am in EU so it's the small hours now and usually that'd be fine but I have to be up early tomorrow and can't adjust it. Can I make a suggestion, especially given you dont have a lot of time...
Back and forth one command at a time may be ideal to avoid mistakes but I suspect it's unnecessary. IF (and only if) you have the time, maybe you could just give me some bullet point instructions and I think I will be able to follow those when I get back tomorrow lunch time.
Whilst I am no developer, I do have a bit of experience with Mac (terminal and finder stuff in Library etc), I certainly know more than the average Mac user.
I can create a directory under home, I have created one called mboxcvt alongside movies, pictures etc, in user home folder which i assume is what you mean.
Hopefully you can drop some steps for me to follow beyond that and I will give it a whirl tomorrow. Dont worry about mistakes my end, worst case I have a TimeMachine drive backing up every hour so I can always roll my system back but I am sure that won't be necessary. i have run a script or two before over the years, as well as adjusting one or two files in Terminal (such as to stop the damn update notifications!)
I have to run now but really grateful for your kindness helping me here. Drop me some tasks and let's see if I can impress myself (if not anybody else :D)
Thank you Mark
Ha, you are supposed to be John (Snow of Game of Thrones?) %-) I will give some more steps, but will need some interaction after. I also have to be brif as typing by eyes is onerous.
Next step, download script:
- Click script link and look for download button on top right,, box with down arrow in it
- Should download to your download dir, then move to our mboxcvt dir
- Now open a terminal
- Change to the home dir with cd ~
- change to mboxcvt cd mboxcvt
- See if the script runs python3 applembox2sbd.py
- you should see it gripe about not having a IN argument (parameter to cmds)
Setting up other directories, you can do regardless of above working
- Under mboxcvt make two directories exptree and exporig
- copy your export tree into both directories
- Explain the the top levels of directories in exptree
We will have to interact tomorrow any time after 12 Eastern time. BTW I always love to know where my users are if you don't mind saying... Christopher
Yes, well spotted, but you're forgetting I have to do sentry duty to watch out for white walkers :-D Unfortunately for me I'm in the UK. Typing by eyes, that must be quite tiring. Will do my best to keep this as short (your end) as possible.
OK, step by step....
- Click script link and look for download button on top right,, box with down arrow in it
Ok, by "script link" I assume you mean the one that goes to this page - https://github.com/thunderbird/import-export-tools-ng/blob/master/utility-scripts/apple2mboxsbd.py Assuming so, I have clicked the download button (one with tooltip: "Download Raw File").
- Should download to your download dir, then move to our mboxcvt dir
I downloaded it straight into mboxcvt dir
- **Now open a terminal
- Change to the home dir with
- cd ~
- change to mboxcvt
- cd mboxcvt
- See if the script runs
- python3 applembox2sbd.py**
ha, no such file or directory. Get this, I remembered one of about 3 commands I know (maybe I was lying when I said I wasn't a dev :) !) and did a "ls" to list contents. Then realised you put the 2 in the wrong place :D - So I ran:
python3 apple2mboxsbd.py
- you should see it gripe about not having a IN argument (parameter to cmds)
Yep! Output:
"usage: apple2mboxsbd.py [-h] [--verbose] [--dry-run] IN apple2mboxsbd.py: error: the following arguments are required: IN"
- **Setting up other directories, you can do regardless of above working
- Under mboxcvt make two directories exptree and exporig**
I am assuming I can do this in Finder so will do it that way. I think I remember mkdir being the command but lack of confidence leads me to Finder wherever possible.
Ok, now we're cooking on gas :)
Here's Finder now:
Ok, these last two bullets I got a bit stuck with.
- copy your export tree into both directories
Assuming I know what you mean but want to be 100% sure before I do anything further. by "export tree", am i right in thinking you mean the entire folder full of exported folders from Mac Mail? If so, you mean my folder called "mailboxes export" which is on my desktop, looks like this:
So should I select all contents OF 'mailboxes export', and copy those into the two folders we created? I guess there's no harm in going ahead and doing that anyway, can always delete. This is done, now both of those folders look like this:
- Explain the top levels of directories in exptree
Wasn't sure but maybe you just mean for me to show what they look like, hopefully done that above.
If my assumptions are correct, I think we are now at the point you hoped I'd be. :)
Thank you again, sorry for all the typing but seems easier for you to read (every detail of my actions) rather than me asking and waiting for you to answer, and have to type more needlessly.
@johnstonesnow Excellent, you were under selling yourself! So now we have our setup ready for converting. from terminal, get to the mboxcvt dir Then: python3 apple2mboxsbd.py ./extptree
Then screenshot the exptree directory, with luck we will have our transform. Christopher
Finished! (I am sure this doesn't need saying but just to be completely thorough, i removed the extra "t" from the command above "./extptree" It ran and "finished!"
I watched Finder live as it happened, like magic. :)
Old on left, New on right
Looks like it worked to my untrained eye.
25 items in each folder The old folders are still folders but with .sbd appended. The old .mbox files have the same name but the .mbox has been removed.
Are we looking good?
thanks so much for this Christopher
@johnstonesnow Fantastic, no problem! Now the tree can be imported. Do you want to do that on Linux? C
Great! That was going to be my next question. Since this is all about moving to Fedora, would it be best to run Thunderbird on the Fedora machine (much more powerful machine), move these files over with USB stick and run the import there? I can run on Mac, whichever you think is best, the only consideration I know of is the performance difference. This machine is an old dog, the Fedora one is a new top spec AMD thinkpad. What say you Mr C? :)
Let's go for broke Mr. Snow, warp speed ahead! Get latest Thunderbird and ImportExportTools up on Fedora and then we can import there. C
Englishman's desk sinks into the floor, new one comes down from ceiling, chandeliers barely move....