thunderbird / import-export-tools-ng

Import Export Tools that supports Thunderbird v68-v128
Other
285 stars 31 forks source link

How to use Apple export script to import to Thunderbird #543

Open johnstonesnow opened 6 months ago

johnstonesnow commented 6 months ago

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.

cleidigh commented 6 months ago

@johnstonesnow What explicitly are you importing, a single mbox or a structure produced from the script we discussed? @cleidigh

johnstonesnow commented 6 months ago

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.

cleidigh commented 6 months ago

@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

johnstonesnow commented 6 months ago

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

cleidigh commented 6 months ago

@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

johnstonesnow commented 6 months ago

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!

cleidigh commented 6 months ago

@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

johnstonesnow commented 6 months ago

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

cleidigh commented 6 months ago

download the script with the raw link. Once you have python 3, you should be able to run it. Christopher

johnstonesnow commented 6 months ago

@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!

johnstonesnow commented 6 months ago

I clicked the "raw" button and got a full page of the code/script

johnstonesnow commented 6 months ago

do I copy that and paste into terminal or something?

johnstonesnow commented 6 months ago

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?

johnstonesnow commented 6 months ago

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 :)

cleidigh commented 6 months ago

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

cleidigh commented 6 months ago

just looked. you should try python3 that should invoke version 3

cleidigh commented 6 months ago

@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

johnstonesnow commented 6 months ago

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" ?

cleidigh commented 6 months ago

@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

johnstonesnow commented 6 months ago

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

cleidigh commented 6 months ago

@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

johnstonesnow commented 6 months ago

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

cleidigh commented 6 months ago

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:

Setting up other directories, you can do regardless of above working

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

johnstonesnow commented 6 months ago

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

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

Yep! Output:

"usage: apple2mboxsbd.py [-h] [--verbose] [--dry-run] IN apple2mboxsbd.py: error: the following arguments are required: IN"

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: Screenshot 2024-03-06 at 14 27 06

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:

Screenshot 2024-03-06 at 14 36 50

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:

Screenshot 2024-03-06 at 14 44 47

- 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.

cleidigh commented 6 months ago

@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

johnstonesnow commented 6 months ago

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

Screenshot 2024-03-06 at 18 39 45

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

cleidigh commented 6 months ago

@johnstonesnow Fantastic, no problem! Now the tree can be imported. Do you want to do that on Linux? C

johnstonesnow commented 6 months ago

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? :)

cleidigh commented 6 months ago

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

johnstonesnow commented 6 months ago

Englishman's desk sinks into the floor, new one comes down from ceiling, chandeliers barely move....

cleidigh commented 6 months ago

you stumped me there...

johnstonesnow commented 6 months ago

I was just switching workstation, maybe I overdid the description a little :P

johnstonesnow commented 6 months ago

Running updates on Fedora briefly, then will install TB.

johnstonesnow commented 6 months ago

Ok, TB installed. ImportExportTools installed

johnstonesnow commented 6 months ago

I guess I need to put exptree folder and contents on a stick to bring over so will do that now

johnstonesnow commented 6 months ago

Can I ask a question...

Hypothetically, if I imported a folder tree into thunderbird (with IETNG or without), then repeated that process, would it append a (2) onto the end of folders?

No, I haven't done any such thing! Just curious, don't want to confuse things at this point, but I THINK I have TWO exports of my mac mail, a much older one, and this recent one we converted with the script. The older one (I just realised) has 5 yrs of older emails than the newer one.

So I am considering running the script on the older Mac Mail export tree, but the folder names are the same. So I wonder if best to append a 2 to all the folders and mbox files in the Mac tree, before conversion. Or just leave it and (as per question above) maybe TB will just append the names of the folders on import, and I can then drag and drop emails into the relevant folders, before deleting the now superfluous '2' folders. If that makes no sense whatsoever, let me know!

cleidigh commented 6 months ago

@johnstonesnow If you import two folders at the top level IETNG will add a suffix. All the folders under can have the same names. I would create two folders under Local Folders one for new and one for old. Then right click and use import mbox choose all mboxes with sbd structure. Then choose the exptree directory. You may want to copy the usb over first. C

johnstonesnow commented 6 months ago

Thanks. not sure I fully understand, here's what I think I should do (hoping you can catch me if I am going wrong anywhere):

  1. Create 2 Local Folders in TB. Let's call them Import1 and Import2.

  2. Right click on Import1, then choose this option:

Screenshot 2024-03-06 at 20 25 51

  1. Point that import at the exptree folder, the one we created and which contains our nicely converted MacMail export.

  2. Run script again on the older MacMail export tree, and repeat the process for that one, except this time I'd right click on Import2 folder in TB sidebar, to import those folders into Import2, from where I can drag and drop to sort out later.

Does that sound about right?

Thanks

cleidigh commented 6 months ago

Exactly

johnstonesnow commented 6 months ago

Ok, I have to go eat then will be back to crack on with the above. I won't expect you to be online then but will drop some updates here, just because I know how much my ramblings mean to you. :D

In case you have any useful input (that's fairly rhetorical at this point!) - two questions:

  1. Spam! 10-15 yrs on Mac Mail, I relied completely on SpamSieve (paid) which only runs on Mac, and was extremely effective (after much training). I have no idea how spam is fought off these days without it! If you have any suggestions (over and above just training TB's "mark as junk" feature, I'd be keen to hear them.

  2. Betterbird - What are your thoughts? A while back I read up a lot on it and it seemed to have many functions I'd miss or want in Thunderbird. I was planning on installing it once I have all my mail set up properly. Your views are welcome on this too, if you have any?

So grateful to you, which leaves me with my final question, please let me know how I can 'donate' to you in some way. Your help has been above and beyond anything I would ever have hoped for, never mind expected. I'd like to send a small token of my gratitude for all this support if I may.

cleidigh commented 6 months ago

@johnstonesnow As far as spam is concerned, Thunderbird has gotten better, but nothing beats Google. Training with your junk should help.

I don't have direct experience with BB, but I prefer the official release. There is a big team behind it and I personally would not support issues with it. Too much to handle.

It's always nice working with patient and appreciative people!

Donations are always very nice. Reviews are also much appreciated! You can do both from the addon home page: https://addons.thunderbird.net/en-US/thunderbird/addon/importexporttools-ng/?src=hp-dl-mostpopular

Cheers Christopher

johnstonesnow commented 6 months ago

Thanks.

Spam - When you say TB has gotten better, so you're talking about just using the standard install options, and train it. That works? If so I'd rather stay as 'vanilla' as possible. You know what these AddOns are like. HAHAHA, sorry, that was payback for the JohnSnow gybes. :D Google - I assume you mean gmail, I don't use gmail. No worries, sounds like I should give vanilla TB filtering a good go before looking any further.

BB - Hmm, in that case I will stick with TB myself. I heard about BB a long while ago and I suspect it was then useful for a few things that TB was struggling with or couldn't do at the time, but I suspect that's old news now.

I have to run now, have import2 going as we speak, Import1 looked good (haven't checked any folders but since everything is marked unread i can see the numbers of emails on each folder and certainly doesn't look like an empty import like before you came along to save the day!

I will love you and leave you (British saying, not sure if it translates over there, hope so!). THANK YOU SO MUCH.

I will be back in a few hours to check things over, try to replicate tons of Mac Mail rules/filters into TB, see how to get contacts over (manually probably!), and somewhere in there I will certainly find time to write a review and drop some proper gratitude your way too.

You've been truly amazing here.

Mark

johnstonesnow commented 6 months ago

PS Just in case I should let you know. I saw the import complete and msg at bottom left corner said: "Import Done 45/65" Is that ok or should I check carefully through email folders?

cleidigh commented 6 months ago

Yes I would check, never know what mbox issues one might have. Could be empty folders. Your appreciation is well noted, and thank you. C

johnstonesnow commented 6 months ago

Do the 45/65 numbers relate to folders? I didn't think there were that many (even 45) but I will double check, I could be wrong. One thing that makes things much harder is how TB sorts all folders with newest email at bottom, instead of top like Mac! Looking for a solution to that so I can check each folder more carefully.

johnstonesnow commented 6 months ago

So far all folders have MORE in (just one or two, or a few in some cases). That's fine by me! Will check all Actually, one has 3929 emails in, whereas the original had 3714. To be honest I'd expect it to be more likely a counting issue on the slower iMac !

cleidigh commented 6 months ago

Should be folders. Check against your tree in finder.

cleidigh commented 6 months ago

Some messages may have been deleted but not compacted out.

johnstonesnow commented 6 months ago

Will do thanks.

Just a thought, re the larger numbers, is it possible it's due to TB having every email as a separate on in the count, but Mac Mail may be counting them by 'conversation', so in a three email thread, it counts as one on mac, but 3 on TB?

cleidigh commented 6 months ago

Should be same Thunderbird to Thunderbird